convection 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +9 -4
- data/bin/convection +3 -1
- data/lib/convection/control/cloud.rb +36 -19
- 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: 2c47278ea072d6254e3d9b6bd60ff0b34b26d5c5
|
4
|
+
data.tar.gz: eae63705e881e7b7efa4cc2a5c3376bc453f39b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6655098f7f79a48236e71f5c20df2a2c236aa3fed7025789d92642df1369d763ec5e70a8e71436f363e062d7549520c6959e5e83452bd454229f0d84bf0f0a0
|
7
|
+
data.tar.gz: 7f8a5150e724eea1ce80a5a6d25a6da6520233242a5a53f985225dabc3739fecc2693269052c75dec5a320e0ef11838cc3305a37dd14e4154af7fc0c48db167a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3
|
1
|
+
2.3
|
data/.travis.yml
CHANGED
data/bin/convection
CHANGED
@@ -18,6 +18,7 @@ module Convection
|
|
18
18
|
desc 'converge STACK', 'Converge your cloud'
|
19
19
|
option :stack_group, :type => :string, :desc => 'The name of a stack group defined in your cloudfile to converge'
|
20
20
|
option :stacks, :type => :array, :desc => 'A ordered space separated list of stacks to converge'
|
21
|
+
option :exclude_stacks, :type => :array, :desc => 'A ordered space separated list of stacks NOT to converge'
|
21
22
|
option :verbose, :type => :boolean, :aliases => '--v', :desc => 'Show stack progress', default: true
|
22
23
|
option :'very-verbose', :type => :boolean, :aliases => '--vv', :desc => 'Show unchanged stacks', default: true
|
23
24
|
option :cloudfiles, :type => :array, :default => %w(Cloudfile)
|
@@ -56,6 +57,7 @@ module Convection
|
|
56
57
|
desc 'diff STACK', 'Show changes that will be applied by converge'
|
57
58
|
option :stack_group, :type => :string, :desc => 'The name of a stack group defined in your cloudfile to diff'
|
58
59
|
option :stacks, :type => :array, :desc => 'A ordered space separated list of stacks to diff'
|
60
|
+
option :exclude_stacks, :type => :array, :desc => 'A ordered space separated list of stacks NOT to diff'
|
59
61
|
option :verbose, :type => :boolean, :aliases => '--v', :desc => 'Show stack progress'
|
60
62
|
option :'very-verbose', :type => :boolean, :aliases => '--vv', :desc => 'Show unchanged stacks'
|
61
63
|
option :cloudfiles, :type => :array, :default => %w(Cloudfile)
|
@@ -131,7 +133,7 @@ module Convection
|
|
131
133
|
cloud_array[:cloud].configure(File.absolute_path(cloud_array[:cloudfile_path], @cwd))
|
132
134
|
cloud = cloud_array[:cloud]
|
133
135
|
region = cloud.cloudfile.region
|
134
|
-
cloud.send(task_name, stack, stack_group: options[:stack_group], stacks: options[:stacks]) do |event, errors|
|
136
|
+
cloud.send(task_name, stack, stack_group: options[:stack_group], stacks: options[:stacks], exclude_stacks: options[:exclude_stacks]) do |event, errors|
|
135
137
|
if options[:cloudfiles].length > 1 && options[:delayed_output]
|
136
138
|
output << { event: event, errors: errors }
|
137
139
|
else
|
@@ -22,31 +22,48 @@ module Convection
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def filter_deck(options = {}, &block)
|
25
|
-
# throw an error if the user specifies
|
26
|
-
if options[:stack_group] && options[:stacks]
|
27
|
-
|
25
|
+
# throw an error if the user specifies more than one (stack group, list of stacks, exclusion list of stacks)
|
26
|
+
if (options[:stack_group] && options[:stacks]) ||
|
27
|
+
(options[:stack_group] && options[:exclude_stacks]) ||
|
28
|
+
(options[:stacks] && options[:exclude_stacks])
|
29
|
+
block.call(Model::Event.new(:error, 'Cannot specify --stack-group , --stack-list, or --exclude-stacks at the same time as each other', :error)) if block
|
28
30
|
return {}
|
29
31
|
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
if options[:stack_group] || options[:stacks]
|
34
|
+
# throw an error if the user specifies a nonexistent stack groups
|
35
|
+
if options[:stack_group] && !stack_groups.key?(options[:stack_group])
|
36
|
+
block.call(Model::Event.new(:error, "Unknown stack group: #{options[:stack_group]}", :error)) if block
|
37
|
+
return {}
|
38
|
+
end
|
36
39
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
# throw an error if the user specifies nonexistent stacks
|
41
|
+
if Array(options[:stacks]).any? { |name| !@cloudfile.stacks.key?(name) }
|
42
|
+
bad_stack_names = options[:stacks].reject { |name| @cloudfile.stacks.key?(name) }
|
43
|
+
block.call(Model::Event.new(:error, "Undefined Stack(s) #{bad_stack_names.join(', ')}", :error)) if block
|
44
|
+
return {}
|
45
|
+
end
|
46
|
+
|
47
|
+
filter = Array(stack_groups[options[:stack_group]] || options[:stacks])
|
48
|
+
filter.reduce({}) do |result, stack_name|
|
49
|
+
result.merge(stack_name => @cloudfile.stacks[stack_name])
|
50
|
+
end
|
51
|
+
|
52
|
+
elsif options[:exclude_stacks]
|
53
|
+
# throw an error if the user specifies nonexistent excluded stacks
|
54
|
+
if Array(options[:exclude_stacks]).any? { |name| !@cloudfile.stacks.key?(name) }
|
55
|
+
bad_stack_names = options[:exclude_stacks].reject { |name| @cloudfile.stacks.key?(name) }
|
56
|
+
block.call(Model::Event.new(:error, "Undefined Stack(s) #{bad_stack_names.join(', ')}", :error)) if block
|
57
|
+
return {}
|
58
|
+
end
|
59
|
+
|
60
|
+
filter = Array(options[:exclude_stacks])
|
61
|
+
return stacks.reject { |stack_name| filter.include? stack_name }
|
43
62
|
|
44
|
-
|
63
|
+
else
|
64
|
+
# if no filter is specified, return the entire deck
|
65
|
+
return stacks
|
45
66
|
|
46
|
-
# if no filter is specified, return the entire deck
|
47
|
-
return stacks if filter.empty?
|
48
|
-
filter.reduce({}) do |result, stack_name|
|
49
|
-
result.merge(stack_name => @cloudfile.stacks[stack_name])
|
50
67
|
end
|
51
68
|
end
|
52
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Manero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|