diff options
Diffstat (limited to 'app/jobs/govuk_guix/fetch_revision_job.rb')
-rw-r--r-- | app/jobs/govuk_guix/fetch_revision_job.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb index fd6e09c..7b1acdf 100644 --- a/app/jobs/govuk_guix/fetch_revision_job.rb +++ b/app/jobs/govuk_guix/fetch_revision_job.rb @@ -27,9 +27,11 @@ class GovukGuix::FetchRevisionJob < Que::Job def run(commit_hash, options = {}) backend_type_and_id = options[:backend_type_and_id] if backend_type_and_id - remote_host = Backends.find_by_type_and_id( + backend = Backends.find_by_type_and_id( *backend_type_and_id.split('=') - ).build_remote_host + ) + + remote_host = backend.build_remote_host end sha = fetch_and_checkout(commit_hash, remote_host) @@ -51,6 +53,8 @@ class GovukGuix::FetchRevisionJob < Que::Job store_path = output.last.strip logger.debug(self.class) { "store_path: #{store_path}" } + backend.add_in_use_store_path(store_path) if backend + GovukGuix::Revision.transaction do GovukGuix::Revision.create( commit_hash: sha, |