cfn-flow 0.2.1 → 0.5.0
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/README.md +6 -1
- data/Rakefile +1 -1
- data/lib/cfn-flow.rb +131 -1
- data/lib/cfn-flow/cli.rb +154 -98
- data/lib/cfn-flow/event_presenter.rb +39 -0
- data/lib/cfn-flow/git.rb +1 -0
- data/lib/cfn-flow/template.rb +64 -50
- data/lib/cfn-flow/version.rb +3 -0
- data/spec/cfn-flow/cli_spec.rb +372 -0
- data/spec/cfn-flow/event_presenter_spec.rb +58 -0
- data/spec/cfn-flow/template_spec.rb +140 -0
- data/spec/cfn-flow_spec.rb +179 -0
- data/spec/data/cfn-flow.yml +12 -4
- data/spec/data/invalid.json +1 -0
- data/spec/data/invalid.yml +3 -0
- data/spec/helper.rb +48 -15
- metadata +19 -23
- data/spec/cfn-flow_cli_spec.rb +0 -30
- data/spec/cfn-flow_template_spec.rb +0 -56
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Suggs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.8
|
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:
|
26
|
+
version: 2.1.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: appraisal
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
description: An opinionated worflow for AWS CloudFormation
|
98
84
|
email: aaron@ktheory.com
|
99
85
|
executables:
|
@@ -107,11 +93,17 @@ files:
|
|
107
93
|
- bin/rake
|
108
94
|
- lib/cfn-flow.rb
|
109
95
|
- lib/cfn-flow/cli.rb
|
96
|
+
- lib/cfn-flow/event_presenter.rb
|
110
97
|
- lib/cfn-flow/git.rb
|
111
98
|
- lib/cfn-flow/template.rb
|
112
|
-
-
|
113
|
-
- spec/cfn-
|
99
|
+
- lib/cfn-flow/version.rb
|
100
|
+
- spec/cfn-flow/cli_spec.rb
|
101
|
+
- spec/cfn-flow/event_presenter_spec.rb
|
102
|
+
- spec/cfn-flow/template_spec.rb
|
103
|
+
- spec/cfn-flow_spec.rb
|
114
104
|
- spec/data/cfn-flow.yml
|
105
|
+
- spec/data/invalid.json
|
106
|
+
- spec/data/invalid.yml
|
115
107
|
- spec/data/sqs.template
|
116
108
|
- spec/data/sqs.yml
|
117
109
|
- spec/helper.rb
|
@@ -128,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
120
|
requirements:
|
129
121
|
- - ">="
|
130
122
|
- !ruby/object:Gem::Version
|
131
|
-
version: 2.
|
123
|
+
version: 2.1.0
|
132
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
125
|
requirements:
|
134
126
|
- - ">="
|
@@ -141,9 +133,13 @@ signing_key:
|
|
141
133
|
specification_version: 4
|
142
134
|
summary: A CLI for CloudFormation templates
|
143
135
|
test_files:
|
144
|
-
- spec/cfn-
|
145
|
-
- spec/cfn-
|
136
|
+
- spec/cfn-flow/cli_spec.rb
|
137
|
+
- spec/cfn-flow/event_presenter_spec.rb
|
138
|
+
- spec/cfn-flow/template_spec.rb
|
139
|
+
- spec/cfn-flow_spec.rb
|
146
140
|
- spec/data/cfn-flow.yml
|
141
|
+
- spec/data/invalid.json
|
142
|
+
- spec/data/invalid.yml
|
147
143
|
- spec/data/sqs.template
|
148
144
|
- spec/data/sqs.yml
|
149
145
|
- spec/helper.rb
|
data/spec/cfn-flow_cli_spec.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative 'helper'
|
2
|
-
|
3
|
-
describe 'CfnFlow::CLI' do
|
4
|
-
let(:cli) { CfnFlow::CLI }
|
5
|
-
|
6
|
-
before do
|
7
|
-
ENV.update({
|
8
|
-
'CFN_FLOW_BUCKET' => 'test-bucket',
|
9
|
-
'CFN_FLOW_FROM' => 'spec/data',
|
10
|
-
'CFN_FLOW_TO' => 'test'
|
11
|
-
})
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '#validate' do
|
15
|
-
it('succeeds') {
|
16
|
-
capture { cli.start %w[validate] }
|
17
|
-
}
|
18
|
-
|
19
|
-
it('can fail') {
|
20
|
-
(Thread.current[:aws_cfn_client] = Aws::CloudFormation::Client.new).
|
21
|
-
stub_responses(:validate_template, 'ValidationError')
|
22
|
-
|
23
|
-
out = capture(:stderr) { cli.start %w(validate) }
|
24
|
-
|
25
|
-
Thread.current[:aws_cfn_client] = nil
|
26
|
-
out.include?("Error validating").must_equal true
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require_relative 'helper'
|
2
|
-
|
3
|
-
describe 'CfnFlow::Template' do
|
4
|
-
|
5
|
-
let(:template) {
|
6
|
-
CfnFlow::Template.new(from: 'spec/data/sqs.template', prefix: 'p', bucket: 'b')
|
7
|
-
}
|
8
|
-
|
9
|
-
let(:yml_template) {
|
10
|
-
CfnFlow::Template.new(from: 'spec/data/sqs.yml', prefix: 'p', bucket: 'b')
|
11
|
-
}
|
12
|
-
|
13
|
-
let(:not_a_template) {
|
14
|
-
CfnFlow::Template.new(from: 'spec/data/cfn-flow.yml', prefix: 'p', bucket: 'b')
|
15
|
-
}
|
16
|
-
|
17
|
-
describe '#initialize' do
|
18
|
-
subject { CfnFlow::Template }
|
19
|
-
|
20
|
-
it('succeeds') do
|
21
|
-
subject.new(from: 'f', prefix: 'p', bucket: 'b').must_be_kind_of CfnFlow::Template
|
22
|
-
end
|
23
|
-
|
24
|
-
it('requires args') do
|
25
|
-
-> { subject.new }.must_raise(ArgumentError)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe '#yaml?' do
|
30
|
-
it 'works' do
|
31
|
-
yml_template.yaml?.must_equal true
|
32
|
-
yml_template.json?.must_equal false
|
33
|
-
template.yaml?.must_equal false
|
34
|
-
template.json?.must_equal true
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#is_cfn_template?' do
|
39
|
-
it 'works' do
|
40
|
-
yml_template.is_cfn_template?.must_equal true
|
41
|
-
template.is_cfn_template?.must_equal true
|
42
|
-
not_a_template.is_cfn_template?.must_equal false
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '#validate!' do
|
47
|
-
it 'can succeed' do
|
48
|
-
template.send(:cfn).stub_responses(:validate_template)
|
49
|
-
template.validate!
|
50
|
-
end
|
51
|
-
it 'can raise an error' do
|
52
|
-
template.send(:cfn).stub_responses(:validate_template, 'ValidationError')
|
53
|
-
-> { template.validate! }.must_raise Aws::CloudFormation::Errors::ValidationError
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|