[ARVADOS] updated: c2bdc5689076ad8512a3f1e2aa8247a76c1359d0

git at public.curoverse.com git at public.curoverse.com
Mon Mar 24 09:45:02 EDT 2014


Summary of changes:
 services/api/script/crunch-dispatch.rb |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

       via  c2bdc5689076ad8512a3f1e2aa8247a76c1359d0 (commit)
      from  3ec81a139360378eedea7ac3044b2c05645c31c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c2bdc5689076ad8512a3f1e2aa8247a76c1359d0
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Mar 24 09:44:56 2014 -0400

    - ARVADOS_INTERNAL is now a bare repository
    - Fixed up repository search to check for both *.git and */.git
    - Will error out of the repository is not found.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index 012c7d0..a90479c 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -152,13 +152,22 @@ class Dispatcher
 
       require 'shellwords'
 
-      arvados_internal = File.join(Rails.configuration.git_repositories_dir, '_arvados_internal')
+      arvados_internal = File.join(Rails.configuration.git_repositories_dir, Commit::ARVADOS_INTERNAL)
       if not File.exists? arvados_internal
-        `mkdir -p #{arvados_internal.shellescape} && cd #{arvados_internal.shellescape} && git init`
+        $stderr.puts `mkdir -p #{arvados_internal.shellescape} && cd #{arvados_internal.shellescape} && git init --bare`
       end
 
-      src_repo = File.join(Rails.configuration.git_repositories_dir, job.repository, '.git')
-      `cd #{arvados_internal.shellescape} && git fetch #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}`
+      src_repo = File.join(Rails.configuration.git_repositories_dir, job.repository + '.git')
+      src_repo = File.join(Rails.configuration.git_repositories_dir, job.repository, '.git') unless File.exists? src_repo
+
+      unless src_repo
+        $stderr.puts "dispatch: #{File.join Rails.configuration.git_repositories_dir, job.repository} doesn't exist"
+        sleep 1
+        untake(job)
+        next
+      end
+      
+      $stderr.puts `cd #{arvados_internal.shellescape} && git fetch --no-tags #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}`
 
       cmd_args << crunch_job_bin
       cmd_args << '--job-api-token'

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list