aboutsummaryrefslogtreecommitdiff
path: root/app/jobs/govuk_guix
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-07-01 08:57:41 +0100
committerChristopher Baines <mail@cbaines.net>2018-07-01 08:57:41 +0100
commit1e324dfdcc47f83ecc613ec8faaf9e378a808bfb (patch)
tree8482b9a72f628b2bdce74adf35afff3aa88beb23 /app/jobs/govuk_guix
parent6de9ae2f55eec21bd2c4f46775598475e71f6463 (diff)
downloadgovuk-mini-environment-admin-1e324dfdcc47f83ecc613ec8faaf9e378a808bfb.tar
govuk-mini-environment-admin-1e324dfdcc47f83ecc613ec8faaf9e378a808bfb.tar.gz
Fix the FetchRevisionJob to better handle remote hosts
Diffstat (limited to 'app/jobs/govuk_guix')
-rw-r--r--app/jobs/govuk_guix/fetch_revision_job.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb
index 8d77761..63a1f04 100644
--- a/app/jobs/govuk_guix/fetch_revision_job.rb
+++ b/app/jobs/govuk_guix/fetch_revision_job.rb
@@ -25,9 +25,14 @@ class GovukGuix::FetchRevisionJob < Que::Job
@retry_interval = 30
def run(commit_hash, options = {})
- remote_host = options[:run_remotely_on_host]
+ backend_type_and_id = options[:backend_type_and_id]
+ if backend_type_and_id
+ remote_host = Backends.find_by_type_and_id(
+ *backend_type_and_id.split('=')
+ ).build_remote_host
+ end
- fetch_and_checkout(commit_hash, remote_host)
+ sha = fetch_and_checkout(commit_hash, remote_host)
command = [
"#{@repository_directory}/guix-pre-inst-env",
@@ -99,6 +104,8 @@ class GovukGuix::FetchRevisionJob < Que::Job
repository.checkout(sha)
end
+
+ return sha
end
def available_services(store_path)