diff options
author | Christopher Baines <mail@cbaines.net> | 2018-06-23 09:21:30 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-06-23 12:58:05 +0100 |
commit | 7fb0c23b891b8734cb04a9690cd030a134f5cd4d (patch) | |
tree | eaac05016a75763698f821bb19816ca63b9acab3 /app/controllers | |
parent | 7302c52a0011556527e5cbb6b0e996bd5bf49508 (diff) | |
download | govuk-mini-environment-admin-7fb0c23b891b8734cb04a9690cd030a134f5cd4d.tar govuk-mini-environment-admin-7fb0c23b891b8734cb04a9690cd030a134f5cd4d.tar.gz |
Add initial support for fetching govuk-guix revisions on remote hosts
This begins to remote the restriction of having to have Guix installed
locally.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/govuk_guix/revisions_controller.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/govuk_guix/revisions_controller.rb b/app/controllers/govuk_guix/revisions_controller.rb index 1e311eb..f7c7f56 100644 --- a/app/controllers/govuk_guix/revisions_controller.rb +++ b/app/controllers/govuk_guix/revisions_controller.rb @@ -26,7 +26,19 @@ class GovukGuix::RevisionsController < ApplicationController def enqueue_fetch_revision revision = params.require('revision') - GovukGuix::FetchRevisionJob.enqueue(revision) + # Attempt to check if this can be performed locally + if File.exist? '/var/guix/daemon-socket/socket' + options = {} + else + # Assume that the AWS backend is in use + backend = Backends::TerraformAws.first + + options = { + run_remotely_on_host: "ubuntu@guix-daemon.#{backend.domain}" + } + end + + GovukGuix::FetchRevisionJob.enqueue(revision, options) flash[:info] = "Fetching govuk-guix revision (#{revision})..." redirect_to setup_path |