stack_master 1.10.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- 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 +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9db7bab79978f6540e7782d510bbfa244e20a17c
|
4
|
+
data.tar.gz: 42668064c6f38367d645112bf2fbea084bd4084c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8399293cf7b92cbdc7573b83863547b75351eff2dbcf6de2c5661365326c75c085d0497eb3f12f92723f3bbfd2cb0942e6cef3f31cc089cb67b1d410fe5824e
|
7
|
+
data.tar.gz: d836db6fdbc9d2fc8b698186e8a51ca10aab899d802144458b7c3179af627483b155476e8f5c5fc6f7601404a7b31cc90c57966422e5fcf936597c43ee825103
|
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: ruby
|
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: dotgpg
|
380
394
|
requirement: !ruby/object:Gem::Requirement
|
@@ -500,7 +514,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
500
514
|
version: '0'
|
501
515
|
requirements: []
|
502
516
|
rubyforge_project:
|
503
|
-
rubygems_version: 2.
|
517
|
+
rubygems_version: 2.4.5.2
|
504
518
|
signing_key:
|
505
519
|
specification_version: 4
|
506
520
|
summary: StackMaster is a sure-footed way of creating, updating and keeping track
|