diff options
author | Christopher Baines <mail@cbaines.net> | 2018-01-28 14:46:03 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-03-29 07:28:09 +0100 |
commit | 97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d (patch) | |
tree | fa2dceba69676cd0a2d35840fea69eb1422b52bd /app/jobs | |
parent | eb3177b0d8de10f316ac595dff3b8165cf828796 (diff) | |
download | govuk-mini-environment-admin-97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d.tar govuk-mini-environment-admin-97f6d7e326a1fd7ddcbe7cf32dc0e4c0a508913d.tar.gz |
Add terraform backend and initial guix configuration
Diffstat (limited to 'app/jobs')
-rw-r--r-- | app/jobs/setup_job.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/jobs/setup_job.rb b/app/jobs/setup_job.rb index c7b1b80..6b4f9fe 100644 --- a/app/jobs/setup_job.rb +++ b/app/jobs/setup_job.rb @@ -1,5 +1,24 @@ +require 'ruby_terraform' + class SetupJob < TerraformJob def run_terraform puts "Setting up #{@mini_environment.name}" + + RubyTerraform.init( + source: 'terraform/aws', + path: 'terraform/aws', + backend: true, + backend_config: { + address: 'http://localhost:3000' + Rails.application.routes.url_helpers.terraform_http_backend_path + } + ) + + RubyTerraform.apply( + directory: 'terraform/aws', + vars: { + slug: @mini_environment.name.parameterize + }, + auto_approve: true + ) end end |