sfn 0.3.0 → 0.3.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/CHANGELOG.md +5 -0
- data/lib/sfn/command.rb +12 -5
- data/lib/sfn/command/create.rb +9 -0
- data/lib/sfn/command/events.rb +7 -2
- data/lib/sfn/command_module/base.rb +1 -5
- data/lib/sfn/command_module/stack.rb +2 -2
- data/lib/sfn/provider.rb +2 -2
- data/lib/sfn/version.rb +1 -1
- data/sfn.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69dfa18182936f431c28d80ce5fa6fbbc356b006
|
4
|
+
data.tar.gz: 5f7cff254502ffaef0a89e3fa0dc005f68a6aa93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34e785122c57f3e05bd498a533dec705026556159c52077967f49cb3058da52cf62f793f10e72d1e202b70ffad7b510154b56f6bb8adf0190bd1a0f558a8b5f7
|
7
|
+
data.tar.gz: 96ec84db44330109ef9b046e0dcd9afa25a5dc9c291e93bad36257b191aed6b6c6a26099c73a0b62061f11d203621e7fab26f4e5f9f99b07be12d381e12e0004
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## v0.3.2
|
2
|
+
* Validate stack name prior to discovery on apply
|
3
|
+
* Update configuration usage to allow runtime modification
|
4
|
+
* Allow `create` command to print-only without requiring API credentials
|
5
|
+
|
1
6
|
## v0.3.0
|
2
7
|
* Conversion from `knife-cloudformation` to `sfn`
|
3
8
|
* Add knife subcommand alias `sparkleformation`
|
data/lib/sfn/command.rb
CHANGED
@@ -17,12 +17,19 @@ module Sfn
|
|
17
17
|
autoload :Validate, 'sfn/command/validate'
|
18
18
|
|
19
19
|
# Override to provide config file searching
|
20
|
-
def initialize(
|
21
|
-
unless(
|
22
|
-
|
23
|
-
discover_config(
|
20
|
+
def initialize(cli_opts, args)
|
21
|
+
unless(cli_opts[:config])
|
22
|
+
cli_opts = cli_opts.to_hash.to_smash(:snake)
|
23
|
+
discover_config(cli_opts)
|
24
|
+
end
|
25
|
+
super(cli_opts, args)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [Smash]
|
29
|
+
def config
|
30
|
+
memoize(:config) do
|
31
|
+
super
|
24
32
|
end
|
25
|
-
super
|
26
33
|
end
|
27
34
|
|
28
35
|
protected
|
data/lib/sfn/command/create.rb
CHANGED
@@ -38,6 +38,15 @@ module Sfn
|
|
38
38
|
unpack_nesting(name, file, :create)
|
39
39
|
else
|
40
40
|
|
41
|
+
if(config[:print_only] && !config[:apply_stacks])
|
42
|
+
ui.info _format_json(
|
43
|
+
translate_template(
|
44
|
+
Sfn::Utils::StackParameterScrubber.scrub!(file)
|
45
|
+
)
|
46
|
+
)
|
47
|
+
return
|
48
|
+
end
|
49
|
+
|
41
50
|
stack = provider.connection.stacks.build(
|
42
51
|
config[:options].dup.merge(
|
43
52
|
:name => name,
|
data/lib/sfn/command/events.rb
CHANGED
@@ -70,12 +70,17 @@ module Sfn
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
# Discover stacks defined within the resources of given stack
|
74
|
+
#
|
75
|
+
# @param stack [Miasma::Models::Orchestration::Stack]
|
73
76
|
def discover_stacks(stack)
|
74
77
|
stack.resources.reload.all.each do |resource|
|
75
78
|
if(resource.type == 'AWS::CloudFormation::Stack')
|
76
79
|
nested_stack = provider.connection.stacks.get(resource.id)
|
77
|
-
|
78
|
-
|
80
|
+
if(nested_stack)
|
81
|
+
@stacks.push(nested_stack).uniq!
|
82
|
+
discover_stacks(nested_stack)
|
83
|
+
end
|
79
84
|
end
|
80
85
|
end
|
81
86
|
end
|
@@ -117,13 +117,9 @@ module Sfn
|
|
117
117
|
arguments
|
118
118
|
end
|
119
119
|
|
120
|
-
# Fetches value from local configuration (#opts) and falls
|
121
|
-
# back to global configuration (#options)
|
122
|
-
#
|
123
|
-
# @return [Object]
|
124
120
|
def config
|
125
121
|
memoize(:config) do
|
126
|
-
|
122
|
+
super
|
127
123
|
end
|
128
124
|
end
|
129
125
|
|
@@ -18,7 +18,7 @@ module Sfn
|
|
18
18
|
# @param stack [Miasma::Models::Orchestration::Stack]
|
19
19
|
# @return [Miasma::Models::Orchestration::Stack]
|
20
20
|
def apply_stacks!(stack)
|
21
|
-
remote_stacks = config
|
21
|
+
remote_stacks = [config[:apply_stack]].flatten.compact
|
22
22
|
remote_stacks.each do |stack_name|
|
23
23
|
remote_stack = provider.connection.stacks.get(stack_name)
|
24
24
|
if(remote_stack)
|
@@ -36,7 +36,7 @@ module Sfn
|
|
36
36
|
# @param remote_stack [Miasma::Models::Orchestration::Stack] stack to inspect for nested stacks
|
37
37
|
# @param stack [Miasma::Models::Orchestration::Stack] current stack
|
38
38
|
# @return [Miasma::Models::Orchestration::Stack]
|
39
|
-
def apply_nested_stacks(remote_stack, stack)
|
39
|
+
def apply_nested_stacks!(remote_stack, stack)
|
40
40
|
remote_stack.resources.all.each do |resource|
|
41
41
|
if(resource.type == 'AWS::CloudFormation::Stack')
|
42
42
|
nested_stack = resource.expand
|
data/lib/sfn/provider.rb
CHANGED
@@ -40,8 +40,8 @@ module Sfn
|
|
40
40
|
# @option args [Numeric] :stack_list_interval interval to wait between stack list refresh
|
41
41
|
def initialize(args={})
|
42
42
|
args = args.to_smash
|
43
|
-
unless(args
|
44
|
-
best_guess = args
|
43
|
+
unless(args.get(:miasma, :provider))
|
44
|
+
best_guess = args.fetch(:miasma, {}).keys.group_by do |key|
|
45
45
|
key.to_s.split('_').first
|
46
46
|
end.sort do |x, y|
|
47
47
|
y.size <=> x.size
|
data/lib/sfn/version.rb
CHANGED
data/sfn.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = 'SparkleFormation CLI'
|
11
11
|
s.license = 'Apache-2.0'
|
12
12
|
s.require_path = 'lib'
|
13
|
-
s.add_dependency 'bogo-cli', '~> 0.1.
|
13
|
+
s.add_dependency 'bogo-cli', '~> 0.1.12'
|
14
14
|
s.add_dependency 'miasma'
|
15
15
|
s.add_dependency 'net-ssh'
|
16
16
|
s.add_dependency 'sparkle_formation', '>= 0.2.8'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo-cli
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.12
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.12
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: miasma
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|