stack_master 1.0.0 → 1.0.1
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/commands/apply.rb +20 -6
- data/lib/stack_master/version.rb +1 -1
- data/spec/stack_master/commands/apply_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2df973e8c51854049665bee6f11cff19b8a7aba
|
4
|
+
data.tar.gz: 2ce1a8f1de5d06e02a47aef292648d79c2c52d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869faae3d938ae4cee9e9e666c25077a308220eaa7544fb8a9e78aeeb6df9870df541871102651a3c45efef0f1258490b50be49f48f6bf68d733e5a57001e85e
|
7
|
+
data.tar.gz: b2958b04187ad83dea0e22909f07a66219214080ce097715d02a06775987dc0f86e86bd55482305e9cb8de59a86e4e02c371cab6834a6ff809cafcaec9280a16
|
@@ -76,13 +76,23 @@ module StackMaster
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def create_stack_by_change_set
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
begin
|
80
|
+
@change_set = ChangeSet.create(stack_options.merge(change_set_type: 'CREATE'))
|
81
|
+
if @change_set.failed?
|
82
|
+
ChangeSet.delete(@change_set.id)
|
83
|
+
halt!(@change_set.status_reason)
|
84
|
+
end
|
85
|
+
|
86
|
+
@change_set.display(StackMaster.stdout)
|
87
|
+
unless ask?('Create stack (y/n)? ')
|
88
|
+
cf.delete_stack(stack_name: stack_name)
|
89
|
+
halt!('Stack creation aborted')
|
90
|
+
end
|
91
|
+
rescue StackMaster::CtrlC
|
83
92
|
cf.delete_stack(stack_name: stack_name)
|
84
|
-
|
93
|
+
raise
|
85
94
|
end
|
95
|
+
|
86
96
|
execute_change_set
|
87
97
|
end
|
88
98
|
|
@@ -102,7 +112,11 @@ module StackMaster
|
|
102
112
|
def update_stack
|
103
113
|
upload_files
|
104
114
|
@change_set = ChangeSet.create(stack_options)
|
105
|
-
|
115
|
+
if @change_set.failed?
|
116
|
+
ChangeSet.delete(@change_set.id)
|
117
|
+
halt!(@change_set.status_reason)
|
118
|
+
end
|
119
|
+
|
106
120
|
@change_set.display(StackMaster.stdout)
|
107
121
|
unless ask?("Apply change set (y/n)? ")
|
108
122
|
ChangeSet.delete(@change_set.id)
|
data/lib/stack_master/version.rb
CHANGED
@@ -109,6 +109,7 @@ RSpec.describe StackMaster::Commands::Apply do
|
|
109
109
|
|
110
110
|
context 'the changeset failed to create' do
|
111
111
|
before do
|
112
|
+
allow(StackMaster::ChangeSet).to receive(:delete)
|
112
113
|
allow(change_set).to receive(:failed?).and_return(true)
|
113
114
|
allow(change_set).to receive(:status_reason).and_return('reason')
|
114
115
|
end
|
@@ -222,6 +223,19 @@ RSpec.describe StackMaster::Commands::Apply do
|
|
222
223
|
expect(StackMaster::ChangeSet).to_not have_received(:execute).with(change_set.id)
|
223
224
|
end
|
224
225
|
end
|
226
|
+
|
227
|
+
context 'user uses ctrl+c' do
|
228
|
+
before do
|
229
|
+
allow(StackMaster).to receive(:non_interactive_answer).and_return('n')
|
230
|
+
allow(cf).to receive(:delete_stack)
|
231
|
+
allow(StackMaster::ChangeSet).to receive(:create).and_raise(StackMaster::CtrlC)
|
232
|
+
end
|
233
|
+
|
234
|
+
it "deletes the stack" do
|
235
|
+
expect(cf).to receive(:delete_stack).with(stack_name: stack_name)
|
236
|
+
expect { apply }.to raise_error
|
237
|
+
end
|
238
|
+
end
|
225
239
|
end
|
226
240
|
|
227
241
|
context 'one or more parameters are empty' do
|
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.0.
|
4
|
+
version: 1.0.1
|
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: 2017-12-
|
12
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|