aboutsummaryrefslogtreecommitdiff
path: root/app/jobs/govuk_guix/fetch_revision_job.rb
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-16 08:51:54 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:55:01 +0100
commit051c8bf612126fa79699c8bf45a661dde127f4a0 (patch)
tree849a3b05b4ab4b59a426761d7cf1da3cc7036349 /app/jobs/govuk_guix/fetch_revision_job.rb
parenta8c8f68971dd9e20dee01d9f65c64283e41fe4a3 (diff)
downloadgovuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar
govuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar.gz
Add backend controllers, models and views
Also annotate existing models.
Diffstat (limited to 'app/jobs/govuk_guix/fetch_revision_job.rb')
-rw-r--r--app/jobs/govuk_guix/fetch_revision_job.rb8
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 b1cb171..f1391cc 100644
--- a/app/jobs/govuk_guix/fetch_revision_job.rb
+++ b/app/jobs/govuk_guix/fetch_revision_job.rb
@@ -3,12 +3,16 @@ require 'git'
require 'open3'
class GovukGuix::FetchRevisionJob < GovukGuix::Job
+ extend EnqueuedJobs
+
@retry_interval = 30
def run(commit_hash)
repository.fetch
- repository.checkout(commit_hash)
+ sha = repository.object(commit_hash).sha
+
+ repository.checkout(sha)
command = [
"#{repository_directory}/guix-pre-inst-env",
@@ -23,7 +27,7 @@ class GovukGuix::FetchRevisionJob < GovukGuix::Job
logger.debug("FetchRevisionJob: store_path: #{store_path}")
GovukGuix::Revision.create(
- commit_hash: commit_hash,
+ commit_hash: sha,
store_path: store_path
)
end