You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/01/25 22:39:46 UTC

[whimsy.git] [1/1] Commit 500b7a9: update working copy in response to board commits

Commit 500b7a92dc75f8b7b24581ccbab7a08477581fd9:
    update working copy in response to board commits


Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>

------------------------------------------------------------
tools/svnupdate.rb                                           | +++++++++++++ 
------------------------------------------------------------
25 changes: 25 additions, 0 deletions.
------------------------------------------------------------


diff --git a/tools/svnupdate.rb b/tools/svnupdate.rb
new file mode 100644
index 0000000..1ea1205
--- /dev/null
+++ b/tools/svnupdate.rb
@@ -0,0 +1,25 @@
+#
+# When mail comes in indicating that foundation/board was updated,
+# update the local working copy.
+#
+
+require 'mail'
+
+mail = Mail.new(STDIN.read)
+
+LOG = '/srv/whimsy/www/logs/svn-update'
+
+if mail.subject =~ %r{^board: r\d+ - in /foundation/board}
+
+  # prevent concurrent updates being performed by the cron job
+  File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
+    log.flock(File::LOCK_EX)
+
+    Dir.chdir '/srv/svn/foundation_board' do
+      `svn cleanup`
+      `svn update`
+    end
+  end
+
+end
+