aboutsummaryrefslogtreecommitdiff
path: root/app/jobs/govuk_guix
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-29 06:53:23 +0100
committerChristopher Baines <mail@cbaines.net>2018-04-03 21:58:55 +0100
commit162d358d5f85fab0d0c5996069d033c8d05c4bf3 (patch)
treeb0cbdb94a66f1f7a9da015f8c0c965f99af9563c /app/jobs/govuk_guix
parent42b87660df9215e81ce1c13a0cc7c1aef3f154b7 (diff)
downloadgovuk-mini-environment-admin-162d358d5f85fab0d0c5996069d033c8d05c4bf3.tar
govuk-mini-environment-admin-162d358d5f85fab0d0c5996069d033c8d05c4bf3.tar.gz
Fix and improve the fetch revision job
Diffstat (limited to 'app/jobs/govuk_guix')
-rw-r--r--app/jobs/govuk_guix/fetch_revision_job.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb
index 8f9ebdf..19ae78c 100644
--- a/app/jobs/govuk_guix/fetch_revision_job.rb
+++ b/app/jobs/govuk_guix/fetch_revision_job.rb
@@ -14,27 +14,27 @@ class GovukGuix::FetchRevisionJob < GovukGuix::Job
command = [
"#{repository_directory}/guix-pre-inst-env",
- "guix",
- "build",
- "-e",
- "(begin (use-modules (gds packages govuk)) (current-govuk-guix))"
+ 'guix',
+ 'build',
+ '-e',
+ '(begin (use-modules (gds packages govuk)) (current-govuk-guix))'
]
- run_command(command) do |output|
- store_path = output.last.strip
- logger.debug("FetchRevisionJob: store_path: #{store_path}")
-
- GovukGuix::Revision.create(
- commit_hash: sha,
- store_path: store_path
- )
- end
+ output = run_command(*command)
+
+ store_path = output.last.strip
+ logger.debug(self.class) { "store_path: #{store_path}" }
+
+ GovukGuix::Revision.create(
+ commit_hash: sha,
+ store_path: store_path
+ )
end
def repository
@_repository ||= begin
- if File.exists? repository_directory
- Git.open(repository_directory, :log => Rails.logger)
+ if File.exist? repository_directory
+ Git.open(repository_directory, log: Rails.logger)
else
Git.clone(repository_remote_location, repository_directory)
end