whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject [whimsy] 02/02: Ensure svn is up to date when generating public_podlings.json.
Date Mon, 12 Jun 2017 23:44:18 GMT
This is an automated email from the ASF dual-hosted git repository.

johndament pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit dcc9aab6f501d7c60073e16acec285929ba81a22
Author: John D. Ament <johndament@apache.org>
AuthorDate: Mon Jun 12 19:44:04 2017 -0400

    Ensure svn is up to date when generating public_podlings.json.
---
 lib/whimsy/asf/svn.rb         | 11 +++++++++++
 www/roster/public_podlings.rb |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 134609c..64a596e 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -141,6 +141,17 @@ module ASF
       return revision, content
     end
 
+    def self.updateSimple(path)
+      cmd = ['svn', 'update', path, '--non-interactive']
+      stdout, status = Open3.capture2(*cmd)
+      revision = 0
+      if status.success?
+        # extract revision number
+        revision = stdout[/^At revision (\d+)/, 1]
+      end
+      revision
+    end
+
     # update a file or directory in SVN, working entirely in a temporary
     # directory
     def self.update(path, msg, env, _, options={})
diff --git a/www/roster/public_podlings.rb b/www/roster/public_podlings.rb
index 7aca641..2f1e95f 100644
--- a/www/roster/public_podlings.rb
+++ b/www/roster/public_podlings.rb
@@ -69,6 +69,11 @@
 
 require_relative 'public_json_common'
 
+incubaorContent = ASF::SVN.find('asf/incubator/public/trunk/content')
+incubatorPodlings = ASF::SVN.find('asf/incubator/public/trunk/content/podlings')
+ASF::SVN.updateSimple(incubaorContent);
+ASF::SVN.updateSimple(incubatorPodlings);
+
 pods = Hash[ASF::Podling.list.map {|podling| [podling.name, podling.status]}]
 
 mtime =  ASF::Podling.mtime # must be after call to list()
@@ -86,6 +91,6 @@ if ARGV.length == 2
   end
   public_json_output_file({
     last_updated: mtime,
-    podling: podh    
+    podling: podh
   }, ARGV[1])
 end

-- 
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <commits@whimsical.apache.org>.

Mime
View raw message