diff options
Diffstat (limited to 'app/jobs')
-rw-r--r-- | app/jobs/destroy_job.rb | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/app/jobs/destroy_job.rb b/app/jobs/destroy_job.rb index a57d530..ff1f713 100644 --- a/app/jobs/destroy_job.rb +++ b/app/jobs/destroy_job.rb @@ -21,25 +21,7 @@ class DestroyJob < MiniEnvironmentJob @retry_interval = 30 - def run_terraform - puts "Destroying #{@mini_environment.name}" - - Dir.chdir('terraform/aws') do - RubyTerraform.destroy( - vars: { - aws_region: 'eu-west-1', - slug: @mini_environment.name.parameterize, - ssh_public_key: ssh_public_key, - start_command: @mini_environment.start_command - }, - force: true - ) - end - end - - def ssh_public_key - File.open("#{ENV['HOME']}/.ssh/id_rsa.pub") do |file| - file.readline() - end + def perform_mini_environment_action + @mini_environment.backend.destroy(@mini_environment) end end |