idlc-sdk-deploy 1.0.0.rc8 → 1.0.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/idlc-sdk-deploy/config.rb +15 -6
- data/lib/idlc-sdk-deploy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d35c6385b97edcade6aba1bf1537e3033597c04b
|
4
|
+
data.tar.gz: f88a36e0269f66a21f385d8ad7137bbdf9ed3b08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269c443a5848219e713d3f6db492c735f8a1928ed3e230eb3bab3dba14a265ae6d1f055768836efedf69032c8a4f4519fb05c228edd1bcb9f9f8c159e6b7609a
|
7
|
+
data.tar.gz: 8481cd2cd8ef05887466a35c5b3781a187667af5c901105abd94b6ee22e9a4d4aa9694e933049f4d7a148756ad769d8a20b18530b922f565e8c1917a5b686d6b
|
@@ -33,11 +33,13 @@ module Idlc
|
|
33
33
|
exit 1
|
34
34
|
end
|
35
35
|
|
36
|
-
def configure_state(bucket, sub_bucket)
|
36
|
+
def configure_state(bucket, sub_bucket, working_directory)
|
37
37
|
validate_environment
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
tf_version = Terraform::Binary::config.version.split('.')
|
40
|
+
|
41
|
+
configure_tfstatev8(bucket, sub_bucket, working_directory) if tf_version[0].to_i == 0 && tf_version[1].to_i <= 8
|
42
|
+
configure_tfstatev9(bucket, sub_bucket, working_directory) if tf_version[0].to_i >= 0 && tf_version[1].to_i > 8
|
41
43
|
end
|
42
44
|
|
43
45
|
def parse(config_file)
|
@@ -58,7 +60,7 @@ module Idlc
|
|
58
60
|
|
59
61
|
private
|
60
62
|
|
61
|
-
def configure_tfstatev8(bucket, sub_bucket)
|
63
|
+
def configure_tfstatev8(bucket, sub_bucket, working_directory)
|
62
64
|
args = []
|
63
65
|
args << '-backend=s3'
|
64
66
|
args << '-backend-config="acl=private"'
|
@@ -68,10 +70,17 @@ module Idlc
|
|
68
70
|
args << "-backend-config=\"region=#{@region}\""
|
69
71
|
|
70
72
|
Terraform::Binary.remote("config #{args.join(' ')}")
|
73
|
+
Terraform::Binary.get("-update #{working_directory}")
|
71
74
|
end
|
72
75
|
|
73
|
-
def configure_tfstatev9
|
74
|
-
|
76
|
+
def configure_tfstatev9(bucket, sub_bucket, working_directory)
|
77
|
+
args = []
|
78
|
+
args << "-backend-config=\"bucket=#{bucket}\""
|
79
|
+
args << "-backend-config=\"key=#{sub_bucket}/terraform.tfstate\""
|
80
|
+
args << "-backend-config=\"region=#{@region}\""
|
81
|
+
args << "-force-copy"
|
82
|
+
|
83
|
+
Terraform::Binary.init("#{args.join(' ')} #{working_directory}")
|
75
84
|
end
|
76
85
|
|
77
86
|
def validate_environment
|