iapi-idlc-sdk-pfm 1.0.17 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01fa98360adc8121e20c60cd777e3b07374319edfddd280dccd34458ded69db6
|
4
|
+
data.tar.gz: ab6612bae1f8e4837eadb9a5474b1dd1f40e15c8c2181f48b7a2bf0c56624e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa516af19c5b4750073ff0d7c17d40f6fac5eebc4332194463d43fe48e06e073bd9af9b8b94b099ec31af7ba191019a6a40e8c41673b8ab5733bd92ca7569af6
|
7
|
+
data.tar.gz: f9064c8865c6c1c651edbcdd71b62bc191879b6d0ca711fd676446f568d4e4e0da0c35634529dd1de3d0ef07a01777f8ad083f99c8ef1852faa86ac57481ad8b
|
@@ -62,7 +62,11 @@ module Pfm
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def apply(dir)
|
65
|
-
|
65
|
+
if upgraded_terraform?
|
66
|
+
Terraform::Binary::Command.run("-chdir #{dir} apply")
|
67
|
+
else
|
68
|
+
Terraform::Binary.apply(dir.to_s) || raise
|
69
|
+
end
|
66
70
|
rescue
|
67
71
|
raise DeploymentFailure, 'Finished with errors'
|
68
72
|
end
|
@@ -194,10 +194,12 @@ module Pfm
|
|
194
194
|
|
195
195
|
# add to vars file and record key for dups
|
196
196
|
keys[key] = 'parsed'
|
197
|
-
|
198
|
-
|
197
|
+
unless upgraded_terraform?
|
198
|
+
vars_file += <<~EOH
|
199
|
+
variable "#{key}" {}
|
199
200
|
|
200
|
-
|
201
|
+
EOH
|
202
|
+
end
|
201
203
|
|
202
204
|
# load value into envrionment
|
203
205
|
Idlc::Deploy::Config.add_deployment_var(key, value)
|
@@ -205,7 +207,9 @@ module Pfm
|
|
205
207
|
end
|
206
208
|
|
207
209
|
# write vars file
|
208
|
-
|
210
|
+
unless upgraded_terraform?
|
211
|
+
File.open("#{config[:working_dir]}/#{env_metadata['environment_key']}-tfvars.tf", 'w') { |file| file.write(vars_file) }
|
212
|
+
end
|
209
213
|
|
210
214
|
# Pass some extra vars for Terraform
|
211
215
|
Idlc::Deploy::Config.add_deployment_var('aws_region', SETTINGS['AWS_REGION'])
|
@@ -231,6 +235,11 @@ module Pfm
|
|
231
235
|
"#{__dir__}/templates/#{@build_metadata.attributes['build_stage'].value}"
|
232
236
|
end
|
233
237
|
|
238
|
+
def upgraded_terraform?
|
239
|
+
major version = Terraform::Binary.config.version.split(".")[0]
|
240
|
+
major_version > 0
|
241
|
+
end
|
242
|
+
|
234
243
|
def build_base_dir
|
235
244
|
"#{SETTINGS['BUILD_BASE_DIR']}/#{@params.first}"
|
236
245
|
end
|
@@ -53,7 +53,11 @@ module Pfm
|
|
53
53
|
Idlc::Deploy::Config.add_deployment_var('build', ENV['SERVER_BUILD'])
|
54
54
|
Idlc::Deploy::Config.add_deployment_var('app_release', 'null')
|
55
55
|
|
56
|
-
|
56
|
+
if upgraded_terraform?
|
57
|
+
Terraform::Binary::Command.run("-chdir #{dir} destroy")
|
58
|
+
else
|
59
|
+
Terraform::Binary.destroy("#{dir}")
|
60
|
+
end
|
57
61
|
rescue
|
58
62
|
raise DeploymentFailure, 'Finished with errors'
|
59
63
|
end
|
@@ -36,9 +36,13 @@ module Pfm
|
|
36
36
|
tf_paths = %W[#{inf_base_dir}/tf lib/tf/modules]
|
37
37
|
|
38
38
|
begin
|
39
|
-
|
40
|
-
#
|
41
|
-
|
39
|
+
if upgraded_terraform?
|
40
|
+
Terraform::Binary::Command.run("-chdir #{inf_base_dir}/tf fmt")
|
41
|
+
else
|
42
|
+
tf_paths.each do |path|
|
43
|
+
# Format the file to a canonical syntax
|
44
|
+
Terraform::Binary.fmt(path)
|
45
|
+
end
|
42
46
|
end
|
43
47
|
rescue
|
44
48
|
raise DeploymentFailure, 'Finished with errors'
|
@@ -70,8 +70,13 @@ module Pfm
|
|
70
70
|
|
71
71
|
def plan(dir)
|
72
72
|
begin
|
73
|
-
|
74
|
-
|
73
|
+
if upgraded_terraform?
|
74
|
+
Terraform::Binary::Command.run("-chdir #{dir} plan") unless @config[:landscape]
|
75
|
+
Terraform::Binary::Command.run("-chdir #{dir} plan | landscape") if @config[:landscape]
|
76
|
+
else
|
77
|
+
Terraform::Binary.plan(dir.to_s) unless @config[:landscape]
|
78
|
+
Terraform::Binary.plan("#{dir} | landscape") if @config[:landscape]
|
79
|
+
end
|
75
80
|
rescue
|
76
81
|
raise DeploymentFailure, 'Finished with errors'
|
77
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iapi-idlc-sdk-pfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Cazell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|