aboutsummaryrefslogtreecommitdiff
path: root/app/jobs
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-05-24 19:00:47 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-24 19:00:47 +0100
commit502c924653c89e96c5b370cf281da59e3a2b3759 (patch)
treeb1708e1238fdf579826c5047cf0798b299ccd9ff /app/jobs
parent4eb5c0f4703671d81a2a4b536282f2be4169dac8 (diff)
downloadgovuk-mini-environment-admin-502c924653c89e96c5b370cf281da59e3a2b3759.tar
govuk-mini-environment-admin-502c924653c89e96c5b370cf281da59e3a2b3759.tar.gz
Show the available services for each revision
Diffstat (limited to 'app/jobs')
-rw-r--r--app/jobs/govuk_guix/fetch_revision_job.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb
index 76e16bd..c2c3c17 100644
--- a/app/jobs/govuk_guix/fetch_revision_job.rb
+++ b/app/jobs/govuk_guix/fetch_revision_job.rb
@@ -47,7 +47,8 @@ class GovukGuix::FetchRevisionJob < GovukGuix::Job
GovukGuix::Revision.create(
commit_hash: sha,
- store_path: store_path
+ store_path: store_path,
+ available_services: available_services(store_path)
)
end
@@ -61,6 +62,17 @@ class GovukGuix::FetchRevisionJob < GovukGuix::Job
end
end
+ def available_services(store_path)
+ command_output = run_command(
+ "#{store_path}/bin/govuk",
+ "system",
+ "available-services",
+ "--json"
+ )
+
+ JSON.parse(command_output.join)
+ end
+
def repository_directory
'tmp/cache/govuk-guix'
end