uc3-sam-sceptre 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -6
- data/lib/uc3-sam-sceptre/version.rb +1 -1
- data/lib/uc3-sam-sceptre.rb +7 -12
- 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: e63bdfbd4d9d332d45f81c48b4113c0e8926253f6eb1d1da3bc21d8a2076a8b0
|
4
|
+
data.tar.gz: 58c2682579403736e4d36ee8febe6f2e78c7567d3d45336f2c6a9069bb18c789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af942b563de3d285cab0b5733d892ee1828fa890b381228eb4b60ef089ba942b41f487b008616211134200cab8898531c6ebb0c7eff9c35133352321cc78ddb
|
7
|
+
data.tar.gz: d52ae61c6465014478c5a7707f29c80ea0f7638441ff9d886c2dbfcc84a756cfe2ce65637d6f623c0eb9cbcf19315c476d13ff959d3ce06d0926368ee3c2f717
|
data/README.md
CHANGED
@@ -210,12 +210,17 @@ if ARGV.length == 2
|
|
210
210
|
{ template_param_name: 'Version', value: 'v0' }
|
211
211
|
]
|
212
212
|
}
|
213
|
-
|
214
213
|
proxy = Uc3SamSceptre::Proxy.new(params)
|
215
|
-
|
216
|
-
|
214
|
+
|
215
|
+
if ARGV[0].to_s.downcase.strip == 'false' && ARGV[1].to_s.downcase.strip == 'false'
|
216
|
+
proxy.delete
|
217
|
+
else
|
218
|
+
proxy.build if ARGV[0].to_s.downcase.strip == 'true'
|
219
|
+
proxy.deploy if ARGV[1].to_s.downcase.strip == 'true'
|
220
|
+
end
|
217
221
|
else
|
218
|
-
p 'Expected 2 arguments: run build? and run deploy? (For example: `ruby sam_build_deploy.rb true true`)'
|
222
|
+
p 'Expected 2 arguments: run build? and run deploy? (For example: `ruby sam_build_deploy.rb true true`).'
|
223
|
+
p 'Setting both arguments to false will trigger a `sam delete`.'
|
219
224
|
end
|
220
225
|
```
|
221
226
|
|
@@ -249,9 +254,15 @@ if ARGV.length == 2
|
|
249
254
|
}
|
250
255
|
|
251
256
|
proxy = Uc3SamSceptre::Proxy.new(params)
|
252
|
-
|
253
|
-
|
257
|
+
|
258
|
+
if ARGV[0].to_s.downcase.strip == 'false' && ARGV[1].to_s.downcase.strip == 'false'
|
259
|
+
proxy.delete
|
260
|
+
else
|
261
|
+
proxy.build if ARGV[0].to_s.downcase.strip == 'true'
|
262
|
+
proxy.deploy if ARGV[1].to_s.downcase.strip == 'true'
|
263
|
+
end
|
254
264
|
else
|
255
265
|
p 'Expected 2 arguments: run build? and run deploy? (For example: `ruby sam_build_deploy.rb true true`)'
|
266
|
+
p 'Setting both arguments to false will trigger a `sam delete`.'
|
256
267
|
end
|
257
268
|
```
|
data/lib/uc3-sam-sceptre.rb
CHANGED
@@ -66,7 +66,12 @@ module Uc3SamSceptre
|
|
66
66
|
|
67
67
|
# Run a SAM deploy
|
68
68
|
def deploy(guided: false)
|
69
|
-
args =
|
69
|
+
args = [
|
70
|
+
"--stack-name #{@stack_name}",
|
71
|
+
"--confirm-changeset #{!@auto}",
|
72
|
+
'--capabilities CAPABILITY_NAMED_IAM',
|
73
|
+
'--disable-rollback false'
|
74
|
+
]
|
70
75
|
|
71
76
|
# Add the S3 or ECR details depending on what we're working with
|
72
77
|
args << "--s3-bucket #{_locate_value(key: @s3_arn_key)&.gsub('arn:aws:s3:::', '')}" unless @s3_arn_key.nil?
|
@@ -81,21 +86,11 @@ module Uc3SamSceptre
|
|
81
86
|
|
82
87
|
# Run a SAM delete
|
83
88
|
def delete
|
84
|
-
|
85
|
-
system "sam delete #{args.join(' ')}"
|
89
|
+
system "sam delete --stack-name #{@stack_name}"
|
86
90
|
end
|
87
91
|
|
88
92
|
private
|
89
93
|
|
90
|
-
def _base_args
|
91
|
-
[
|
92
|
-
"--stack-name #{@stack_name}",
|
93
|
-
"--confirm-changeset #{!@auto}",
|
94
|
-
'--capabilities CAPABILITY_NAMED_IAM',
|
95
|
-
'--disable-rollback false'
|
96
|
-
]
|
97
|
-
end
|
98
|
-
|
99
94
|
# Construct the AWS tags that SAM will use when building resources
|
100
95
|
def _sam_tags(admin_email: nil)
|
101
96
|
tags = [
|