[ARVADOS] updated: dd2749162fb95d7a975d664baa01d24f529bd2ae
git at public.curoverse.com
git at public.curoverse.com
Sun Mar 29 14:26:48 EDT 2015
Summary of changes:
services/api/script/crunch-dispatch.rb | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
via dd2749162fb95d7a975d664baa01d24f529bd2ae (commit)
from f71727b4febac13b77141a62afb6f5313f589399 (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 dd2749162fb95d7a975d664baa01d24f529bd2ae
Author: Brett Smith <brett at curoverse.com>
Date: Sun Mar 29 14:26:41 2015 -0400
4253: Fixup crunch-dispatch.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index ab4f70e..c07ddb0 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -66,6 +66,7 @@ class Dispatcher
end
@repo_root = Rails.configuration.git_repositories_dir
+ @arvados_repo_path = Repository.where(name: "arvados").server_path
@authorizations = {}
@did_recently = {}
@fetched_commits = {}
@@ -276,19 +277,10 @@ class Dispatcher
@authorizations[job.uuid]
end
- def get_commit(repo_name, commit_hash)
+ def get_commit(src_repo, commit_hash)
# @fetched_commits[V]==true if we know commit V exists in the
# arvados_internal git repository.
if !@fetched_commits[commit_hash]
- src_repo = File.join(@repo_root, "#{repo_name}.git")
- if not File.exists? src_repo
- src_repo = File.join(@repo_root, repo_name, '.git')
- if not File.exists? src_repo
- fail_job job, "No #{repo_name}.git or #{repo_name}/.git at #{@repo_root}"
- return nil
- end
- end
-
# check if the commit needs to be fetched or not
commit_rev = stdout_s(git_cmd("rev-list", "-n1", commit_hash),
err: "/dev/null")
@@ -383,11 +375,17 @@ class Dispatcher
"GEM_PATH=#{ENV['GEM_PATH']}")
end
+ repo = Repository.where(name: job.repository).first
+ if repo.nil? or repo.server_path.nil?
+ fail_job "Repository #{job.repository} not found under #{@repo_root}"
+ next
+ end
+
ready = (get_authorization(job) and
- get_commit(job.repository, job.script_version) and
+ get_commit(repo.server_path, job.script_version) and
tag_commit(job.script_version, job.uuid))
if ready and job.arvados_sdk_version
- ready = (get_commit("arvados", job.arvados_sdk_version) and
+ ready = (get_commit(@arvados_repo_path, job.arvados_sdk_version) and
tag_commit(job.arvados_sdk_version, "#{job.uuid}-arvados-sdk"))
end
next unless ready
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list