aboutsummaryrefslogtreecommitdiff
path: root/app/jobs
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-26 21:01:51 +0100
committerChristopher Baines <mail@cbaines.net>2018-04-03 21:57:39 +0100
commita210b2363f962de59c2b9287bf675fafe386adc7 (patch)
tree51b46250363a93516813939743a35bc51559df09 /app/jobs
parent7eaab4794bf107976bf7ec07a7a06f1bd27f3201 (diff)
downloadgovuk-mini-environment-admin-a210b2363f962de59c2b9287bf675fafe386adc7.tar
govuk-mini-environment-admin-a210b2363f962de59c2b9287bf675fafe386adc7.tar.gz
Appease Rubocop
Diffstat (limited to 'app/jobs')
-rw-r--r--app/jobs/govuk_guix/generate_start_command_job.rb20
-rw-r--r--app/jobs/govuk_guix/generate_vm_image_and_system_job.rb20
-rw-r--r--app/jobs/govuk_guix/job.rb2
3 files changed, 22 insertions, 20 deletions
diff --git a/app/jobs/govuk_guix/generate_start_command_job.rb b/app/jobs/govuk_guix/generate_start_command_job.rb
index 4bd14a2..9820dcc 100644
--- a/app/jobs/govuk_guix/generate_start_command_job.rb
+++ b/app/jobs/govuk_guix/generate_start_command_job.rb
@@ -2,30 +2,30 @@ class GovukGuix::GenerateStartCommandJob < GovukGuix::Job
@retry_interval = 30
def run(mini_environment_id)
- logger.info "GovukGuix::GenerateStartCommandJob: Building mini environment #{mini_environment_id}"
+ logger.info "#{self.class}: Building mini environment #{mini_environment_id}"
mini_environment = MiniEnvironment.find(mini_environment_id)
slug = mini_environment.name.parameterize
-
+
command = [
"#{mini_environment.govuk_guix_revision.store_path}/bin/govuk",
- "system",
- "build",
- "--rails-environment=production",
+ 'system',
+ 'build',
+ '--rails-environment=production',
"--app-domain=#{slug}.aws.cbaines.net",
"--web-domain=www.#{slug}.aws.cbaines.net",
- "--use-high-ports=false",
- "--use-https=certbot",
- "--fallback",
+ '--use-high-ports=false',
+ '--use-https=certbot',
+ '--fallback',
'whitehall',
'government-frontend'
]
run_command(command) do |output|
store_path = output.last.strip
- logger.debug("GovukGuix::GenerateStartCommandJob: start_command: #{store_path}")
-
+ logger.debug("#{self.class}: start_command: #{store_path}")
+
mini_environment.update(
backend_data: {
start_command: store_path
diff --git a/app/jobs/govuk_guix/generate_vm_image_and_system_job.rb b/app/jobs/govuk_guix/generate_vm_image_and_system_job.rb
index c47e458..1c84577 100644
--- a/app/jobs/govuk_guix/generate_vm_image_and_system_job.rb
+++ b/app/jobs/govuk_guix/generate_vm_image_and_system_job.rb
@@ -2,23 +2,25 @@ class GovukGuix::GenerateVmImageAndSystemJob < GovukGuix::Job
@retry_interval = 30
def run(mini_environment_id)
- logger.info "#{self.class}: Building mini environment #{mini_environment_id}"
+ logger.info(
+ "#{self.class}: Building mini environment #{mini_environment_id}"
+ )
mini_environment = MiniEnvironment.find(mini_environment_id)
slug = mini_environment.name.parameterize
-
+
command = [
"#{mini_environment.govuk_guix_revision.store_path}/bin/govuk",
- "system",
- "build",
- "--rails-environment=production",
+ 'system',
+ 'build',
'--type=vm-image-and-system',
+ '--rails-environment=production',
"--app-domain=#{slug}.aws.cbaines.net",
"--web-domain=www.#{slug}.aws.cbaines.net",
- "--use-high-ports=false",
- "--use-https=certbot",
- "--fallback",
+ '--use-high-ports=false',
+ '--use-https=certbot',
+ '--fallback',
'whitehall',
'government-frontend'
]
@@ -26,7 +28,7 @@ class GovukGuix::GenerateVmImageAndSystemJob < GovukGuix::Job
run_command(command) do |output|
store_path = output.last.strip
logger.debug "#{self.class}: vm_image_and_system: #{store_path}"
-
+
mini_environment.update(
backend_data: {
vm_image_and_system: store_path
diff --git a/app/jobs/govuk_guix/job.rb b/app/jobs/govuk_guix/job.rb
index b9b8bef..295f77d 100644
--- a/app/jobs/govuk_guix/job.rb
+++ b/app/jobs/govuk_guix/job.rb
@@ -4,7 +4,7 @@ class GovukGuix::Job < Que::Job
def run_command(command)
logger.debug("#{self.class}: Running command #{command.join(' ')}")
- Open3.popen2e(*command) do |stdin, stdout_and_stderr, wait_thr|
+ Open3.popen2e(*command) do |_stdin, stdout_and_stderr, wait_thr|
logger.info("#{self.class}: commmand running, pid #{wait_thr.pid}")
output = []