idlc-sdk-deploy 1.0.13 → 1.0.14
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 +48 -48
- data/lib/idlc-sdk-deploy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c09fbfe1bbad55c136e3a6861ed2e705510ef0e7df7d28d87aa2248ff5ecc4
|
4
|
+
data.tar.gz: 10c084ff29eac6495ce0af24607f16b10a5edeca12dd156ab8fbe56321399098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b31d096b3dd0bd0b5ba6417ad020d5e142102fcfaa41ccc2081b375cc8858f7875298bf5f078fbfaa71fd38b542b53d3f28f6ac0bae921f400c91e1cd1a948ef
|
7
|
+
data.tar.gz: 1ae1b19fd117c2e9a26f4f565f0d3c8d4ed51e4e16793511d9a565fc51e5a98262296202d48c94f5fd57200f489476d4fdefe4f3ba55bd7e2b370b14fb5242c2
|
@@ -40,6 +40,54 @@ module Idlc
|
|
40
40
|
# return environment metadata
|
41
41
|
get_env_metadata(instance['tags']['environment_key'])
|
42
42
|
end
|
43
|
+
|
44
|
+
def get_env_metadata(env_key)
|
45
|
+
client = Idlc::AWSLambdaProxy.new()
|
46
|
+
|
47
|
+
request = {
|
48
|
+
service: 'deploy',
|
49
|
+
method: 'GET',
|
50
|
+
lambda: 'metadata',
|
51
|
+
pathParameters: {
|
52
|
+
jobName: env_key
|
53
|
+
}
|
54
|
+
}
|
55
|
+
metadata = client.fetch(request)['deployments'].first
|
56
|
+
|
57
|
+
request = {
|
58
|
+
service: 'config',
|
59
|
+
method: 'GET',
|
60
|
+
lambda: "accounts",
|
61
|
+
pathParameters: {
|
62
|
+
accountName: metadata['environment']['account_alias']
|
63
|
+
}
|
64
|
+
}
|
65
|
+
account = client.fetch(request)
|
66
|
+
|
67
|
+
metadata['account'] = account['accounts'].first
|
68
|
+
|
69
|
+
request = {
|
70
|
+
service: 'config',
|
71
|
+
method: 'GET',
|
72
|
+
lambda: "applications",
|
73
|
+
pathParameters: {
|
74
|
+
appName: metadata['environment']['application_name'].downcase
|
75
|
+
}
|
76
|
+
}
|
77
|
+
application = client.fetch(request)
|
78
|
+
|
79
|
+
metadata['application'] = application['applications'].first
|
80
|
+
|
81
|
+
# find db instance
|
82
|
+
metadata['instances'].each do |instance|
|
83
|
+
if instance['hostname'].start_with? 'db'
|
84
|
+
metadata['db_instance'] = instance
|
85
|
+
break
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
metadata
|
90
|
+
end
|
43
91
|
end
|
44
92
|
|
45
93
|
def initialize(region)
|
@@ -118,54 +166,6 @@ module Idlc
|
|
118
166
|
hostname
|
119
167
|
end
|
120
168
|
|
121
|
-
def get_env_metadata(env_key)
|
122
|
-
client = Idlc::AWSLambdaProxy.new()
|
123
|
-
|
124
|
-
request = {
|
125
|
-
service: 'deploy',
|
126
|
-
method: 'GET',
|
127
|
-
lambda: 'metadata',
|
128
|
-
pathParameters: {
|
129
|
-
jobName: env_key
|
130
|
-
}
|
131
|
-
}
|
132
|
-
metadata = client.fetch(request)['deployments'].first
|
133
|
-
|
134
|
-
request = {
|
135
|
-
service: 'config',
|
136
|
-
method: 'GET',
|
137
|
-
lambda: "accounts",
|
138
|
-
pathParameters: {
|
139
|
-
accountName: metadata['environment']['account_alias']
|
140
|
-
}
|
141
|
-
}
|
142
|
-
account = client.fetch(request)
|
143
|
-
|
144
|
-
metadata['account'] = account['accounts'].first
|
145
|
-
|
146
|
-
request = {
|
147
|
-
service: 'config',
|
148
|
-
method: 'GET',
|
149
|
-
lambda: "applications",
|
150
|
-
pathParameters: {
|
151
|
-
appName: metadata['environment']['application_name'].downcase
|
152
|
-
}
|
153
|
-
}
|
154
|
-
application = client.fetch(request)
|
155
|
-
|
156
|
-
metadata['application'] = application['applications'].first
|
157
|
-
|
158
|
-
# find db instance
|
159
|
-
metadata['instances'].each do |instance|
|
160
|
-
if instance['hostname'].start_with? 'db'
|
161
|
-
metadata['db_instance'] = instance
|
162
|
-
break
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
metadata
|
167
|
-
end
|
168
|
-
|
169
169
|
def configure_tfstatev8(bucket, sub_bucket, working_directory)
|
170
170
|
args = []
|
171
171
|
args << '-backend=s3'
|