10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/bb8/commands/terraform.rb', line 10
def call
`git pull origin`
Dir.chdir environment
BB8::SetEncryptionKeys.call
`cp ../common.tf common.tf` if File.exist?('../common.tf')
Dir['*.enc'].each { |path| BB8::Decrypt.call path }
system "terraform #{command} #{arguments.join(' ')}"
Dir['*.tfvars'].each { |path| BB8::Encrypt.call path }
Dir['*.tfstate'].each { |path| BB8::Encrypt.call path }
Dir['*.tfstate.backup'].each { |path| BB8::Encrypt.call path }
Dir.chdir '..'
`git add .`
`git commit -m "[bb8] Update Terraform files after running #{command}"`
`git push origin`
end
|