stack_master 1.10.0-x64-mingw32 → 1.11.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stack_master/cli.rb +1 -0
- data/lib/stack_master/commands/apply.rb +15 -2
- data/lib/stack_master/stack_differ.rb +9 -0
- data/lib/stack_master/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cfbc93d8edf18647233e174b46196be7ad16dd1
|
4
|
+
data.tar.gz: 3431f933774e45e3053d4fad25d9a82a9b5f6934
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196fbf0770448ca96f3aa0c7a9b3f8006fec906b43bf2683bcfc5393dfb56bf42fe8bb582665ed266dff13587e447e21f29d277a01872092b87d445f053ad915
|
7
|
+
data.tar.gz: 226efce82d37df249ce719e0f1387ea5469f85a09270ac764aec751029591062bf1d54788bd1931e830c603d009421e0530e634504cfef5a1f62d3a8e5347fc5
|
data/lib/stack_master/cli.rb
CHANGED
@@ -42,6 +42,7 @@ module StackMaster
|
|
42
42
|
c.description = "Creates or updates a stack. Shows a diff of the proposed stack's template and parameters. Tails stack events until CloudFormation has completed."
|
43
43
|
c.example 'update a stack named myapp-vpc in us-east-1', 'stack_master apply us-east-1 myapp-vpc'
|
44
44
|
c.option '--on-failure ACTION', String, "Action to take on CREATE_FAILURE. Valid Values: [ DO_NOTHING | ROLLBACK | DELETE ]. Default: ROLLBACK\nNote: You cannot use this option with Serverless Application Model (SAM) templates."
|
45
|
+
c.option '--yes-param PARAM_NAME', String, "Auto-approve stack updates when only parameter PARAM_NAME changes"
|
45
46
|
c.action do |args, options|
|
46
47
|
options.defaults config: default_config_file
|
47
48
|
execute_stacks_command(StackMaster::Commands::Apply, args, options)
|
@@ -13,6 +13,7 @@ module StackMaster
|
|
13
13
|
@from_time = Time.now
|
14
14
|
@options = options
|
15
15
|
@options.on_failure ||= nil
|
16
|
+
@options.yes_param ||= nil
|
16
17
|
end
|
17
18
|
|
18
19
|
def perform
|
@@ -59,7 +60,11 @@ module StackMaster
|
|
59
60
|
|
60
61
|
def diff_stacks
|
61
62
|
abort_if_review_in_progress
|
62
|
-
|
63
|
+
differ.output_diff
|
64
|
+
end
|
65
|
+
|
66
|
+
def differ
|
67
|
+
@differ ||= StackDiffer.new(proposed_stack, stack)
|
63
68
|
end
|
64
69
|
|
65
70
|
def create_or_update_stack
|
@@ -125,12 +130,20 @@ module StackMaster
|
|
125
130
|
halt!(@change_set.status_reason)
|
126
131
|
end
|
127
132
|
|
133
|
+
if differ.single_param_update?(@options.yes_param)
|
134
|
+
StackMaster.stdout.puts("Auto-approving update to single parameter #{@options.yes_param}")
|
135
|
+
else
|
136
|
+
ask_update_confirmation!
|
137
|
+
end
|
128
138
|
@change_set.display(StackMaster.stdout)
|
139
|
+
execute_change_set
|
140
|
+
end
|
141
|
+
|
142
|
+
def ask_update_confirmation!
|
129
143
|
unless ask?("Apply change set (y/n)? ")
|
130
144
|
ChangeSet.delete(@change_set.id)
|
131
145
|
halt! "Stack update aborted"
|
132
146
|
end
|
133
|
-
execute_change_set
|
134
147
|
end
|
135
148
|
|
136
149
|
def upload_files
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "diffy"
|
2
|
+
require "hashdiff"
|
2
3
|
|
3
4
|
module StackMaster
|
4
5
|
class StackDiffer
|
@@ -72,6 +73,14 @@ module StackMaster
|
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
76
|
+
def single_param_update?(param_name)
|
77
|
+
return false if param_name.blank? || @current_stack.blank? || body_different?
|
78
|
+
differences = HashDiff.diff(@current_stack.parameters_with_defaults, @proposed_stack.parameters_with_defaults)
|
79
|
+
return false if differences.count != 1
|
80
|
+
diff = differences[0]
|
81
|
+
diff[0] == "~" && diff[1] == param_name
|
82
|
+
end
|
83
|
+
|
75
84
|
private
|
76
85
|
|
77
86
|
def display_diff(thing, diff)
|
data/lib/stack_master/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_master
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Steve Hodgkiss
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-09
|
12
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -375,6 +375,20 @@ dependencies:
|
|
375
375
|
- - ">="
|
376
376
|
- !ruby/object:Gem::Version
|
377
377
|
version: '0'
|
378
|
+
- !ruby/object:Gem::Dependency
|
379
|
+
name: hashdiff
|
380
|
+
requirement: !ruby/object:Gem::Requirement
|
381
|
+
requirements:
|
382
|
+
- - ">="
|
383
|
+
- !ruby/object:Gem::Version
|
384
|
+
version: '0'
|
385
|
+
type: :runtime
|
386
|
+
prerelease: false
|
387
|
+
version_requirements: !ruby/object:Gem::Requirement
|
388
|
+
requirements:
|
389
|
+
- - ">="
|
390
|
+
- !ruby/object:Gem::Version
|
391
|
+
version: '0'
|
378
392
|
- !ruby/object:Gem::Dependency
|
379
393
|
name: diff-lcs
|
380
394
|
requirement: !ruby/object:Gem::Requirement
|