[ARVADOS] created: 84e9ab15e2068b0e0384e05d3839d16b6a71dc51

git at public.curoverse.com git at public.curoverse.com
Thu Sep 18 16:35:20 EDT 2014


        at  84e9ab15e2068b0e0384e05d3839d16b6a71dc51 (commit)


commit 84e9ab15e2068b0e0384e05d3839d16b6a71dc51
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 18 16:34:03 2014 -0400

    3901: Add missing error checks while copying git objects.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index d316d92..a0d95fa 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -246,18 +246,26 @@ class Dispatcher
         $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')
-      src_repo = File.join(Rails.configuration.git_repositories_dir, job.repository, '.git') unless File.exists? src_repo
+      repo_root = Rails.configuration.git_repositories_dir
+      src_repo = File.join(repo_root, job.repository + '.git')
+      if not File.exists? src_repo
+        src_repo = File.join(repo_root, job.repository, '.git')
+        if not File.exists? src_repo
+          $stderr.puts "dispatch: No #{job.repository}.git or #{job.repository}/.git at #{repo_root}"
+          sleep 1
+          untake job
+          next
+        end
+      end
 
-      unless src_repo
-        $stderr.puts "dispatch: #{File.join Rails.configuration.git_repositories_dir, job.repository} doesn't exist"
+      $stderr.puts `cd #{arvados_internal.shellescape} && git fetch-pack --all #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}`
+      unless $? == 0
+        $stderr.puts "dispatch: git fetch-pack && tag failed"
         sleep 1
-        untake(job)
+        untake job
         next
       end
 
-      $stderr.puts `cd #{arvados_internal.shellescape} && git fetch-pack --all #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}`
-
       cmd_args << crunch_job_bin
       cmd_args << '--job-api-token'
       cmd_args << job_auth.api_token

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list