sfn 2.0.6 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 932b1dd44a660a08997530244880226b82ccce30
4
- data.tar.gz: 3d6b9402858c40a92627c1b8b2b60062fc363a99
3
+ metadata.gz: 4dc5791789b8e7f511712d9d81e8352f8e4780db
4
+ data.tar.gz: e98faf54dde7e50b2677e6cd8eb11cb5f07c55b1
5
5
  SHA512:
6
- metadata.gz: afe324f57a37e74133a776a33ee1bd1fcf068085dc13737627c24b2f284c9920923ee87f0838d3396143d4e6b017410c39b38f25cf612946ba1d1d7d70cf01ba
7
- data.tar.gz: 9e81542e7eaeb6ea50ba7cf4459f7e055897be01bffb28e43f889b6cd9d0149f027ae0c759fada3e241b32e9138b4d24352587687b63980cdc7404ade050c4d8
6
+ metadata.gz: e6d304c36c90b3776397d17a940a3e3a8eab174c9492f84151f6f96f2a78b8d176b3db05a204bf08c447603ed39ea5af65a7d4f1ef54ac6230e6c69312967ff7
7
+ data.tar.gz: 1d25448614c1252fd5d66644e33d028c9b4eef596347ea7c373758ca0bfebf68dcec906424d83b06083c7253abd8efda1b280e37716531e234065679f80a15af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v2.1.0
2
+ * [fix] Use SparkleFormation::Collection helper to ensure proper pack ordering (#115)
3
+ * [fix] Set minimum constraint on sparkle_formation library to 2.1.2
4
+
1
5
  # v2.0.6
2
6
  * [fix] Remove bundler assumption within `init` command (#114)
3
7
 
data/README.md CHANGED
@@ -5,312 +5,16 @@
5
5
  SparkleFormation command line interface for interacting
6
6
  with orchestration APIs.
7
7
 
8
- ## Extra Documentation
9
-
10
- * [User Documentation](http://www.sparkleformation.io/docs/sfn/)
11
-
12
8
  ## API Compatibility
13
9
 
14
10
  * AWS
15
11
  * Rackspace
16
12
  * OpenStack
13
+ * Azure
17
14
 
18
- ## Configuration
19
-
20
- Configuration is defined within a `.sfn` file. The
21
- `sfn` command will start from the current working
22
- directory and work up to the root of the file system
23
- to discover this file.
24
-
25
- ### Configuration formats
26
-
27
- The configuration file can be provided in a variety of
28
- formats:
29
-
30
- #### JSON
31
-
32
- ```json
33
- {
34
- "credentials": {
35
- MIASMA_CREDENTIALS
36
- },
37
- "options": {
38
- "disable_rollback": true
39
- }
40
- }
41
- ```
42
-
43
- #### YAML
44
-
45
- ```yaml
46
- ---
47
- :credentials:
48
- :fubar: true
49
- :options:
50
- :disable_rollback: true
51
- ```
52
-
53
- #### XML
54
-
55
- ```xml
56
- <configuration>
57
- <credentials>
58
- MIASMA_CREDENTIALS
59
- </credentials>
60
- <options>
61
- <disable_rollback>
62
- true
63
- </disable_rollback>
64
- </options>
65
- </configuration>
66
- ```
67
-
68
- #### Ruby
69
-
70
- ```ruby
71
- Configuration.new do
72
- credentials do
73
- MIASMA_CREDENTIALS
74
- end
75
- options.on_failure 'nothing'
76
- end
77
- ```
78
-
79
-
80
- ## Commands
81
-
82
- * `sfn list`
83
- * `sfn create`
84
- * `sfn update`
85
- * `sfn destroy`
86
- * `sfn events`
87
- * `sfn describe`
88
- * `sfn inspect`
89
- * `sfn validate`
90
- * `sfn diff`
91
-
92
- _NOTE: All commands respond to `--help` and will provide a full list of valid options._
93
-
94
- ### `sfn list`
95
-
96
- Provides listing of current stacks and state of each stack.
97
-
98
- ### `sfn validate`
99
-
100
- Validates template with API
101
-
102
- ### `sfn create NAME`
103
-
104
- Creates a new stack with the provided name (`NAME`).
105
-
106
-
107
- #### Processing
108
-
109
- The default behavior of this plugin assumes templates will be
110
- in JSON format. The `--processing` flag will allow providing Ruby
111
- files to dynamically generate templates using the SparkleFormation
112
- library.
113
-
114
- _NOTE: [SparkleFormation Usage Documentation](http://www.sparkleformation.io/docs/sparkle_formation/)._
115
-
116
- This plugin supports the advanced stack nesting feature provided by
117
- the SparkleFormation library.
118
-
119
- #### Translations
120
-
121
- Translations are currently an `alpha` feature and only a subset of
122
- resources are supported.
123
-
124
- ### `sfn update STACK`
125
-
126
- Update an existing stack.
127
-
128
- ### `sfn diff STACK`
129
-
130
- View resources differences that would be applied to a running stack
131
- on update.
132
-
133
- ### `sfn destroy STACK`
134
-
135
- Destroy an existing stack.
136
-
137
- #### Name globs
138
-
139
- The destroy command supports globbing for performing multiple
140
- destructions based on glob match. For example, given existing
141
- stacks:
142
-
143
- * TestStack1
144
- * TestStack2
145
- * Production
146
-
147
- running the following command:
148
-
149
- ```
150
- $ sfn destroy Test*
151
- ```
152
-
153
- will destroy the `TestStack1` and `TestStack2`
15
+ ## Documentation
154
16
 
155
- ### `sfn events STACK`
156
-
157
- Display the event listing of given stack. If the state of the
158
- stack is "in progress", the polling option will result in
159
- polling and displaying new events until the stack reaches a
160
- completed state.
161
-
162
- ### `sfn describe STACK`
163
-
164
- Display resources and outputs of give stack.
165
-
166
-
167
- ### `sfn inspect STACK`
168
-
169
- The stack inspection command simply provides a proxy to the
170
- underlying resource modeling objects provided via the
171
- [miasma][miasma] library. It also provides extra helpers for
172
- running common inspection commands.
173
-
174
- ### Interesting `inspect` options
175
-
176
- * `--nodes` list node addresses within stack
177
- * `--instance-failure [LOG_FILE]` print log file from failed instance
178
- * `--attribute ATTR` print stack attribute
179
-
180
- #### `--nodes`
181
-
182
- This option will return a list of compute instance IDs and
183
- their addresses. The result will be a complete list including
184
- direct compute resources within the stack as well as compute
185
- resources that are part of auto scaling group resouces.
186
-
187
- #### `--instance-failure [LOG_FILE]`
188
-
189
- If the stack create or update failed due to a compute instance,
190
- this option will attempt to locate the instance, connect to
191
- it and download the defined log file. The default log file
192
- is set to: `/var/log/chef/client.log`
193
-
194
- #### `--attribute ATTR`
195
-
196
- The attribute option is what provides the proxy to the underlying
197
- [miasma][miasma] resource modeling. The value of `ATTR` is what should be
198
- called on the `Miasma::Models::Orchestration::Stack` instance.
199
- For example, to display the JSON template of a stack:
200
-
201
- ```
202
- $ sfn inspect STACK -a template
203
- ```
204
-
205
- To display the resource collection of the stack:
206
-
207
- ```
208
- $ sfn inspect STACK -a resources
209
- ```
210
-
211
- This will provide a list of resources. Now, to make this more
212
- useful, we can start inspect specific resources. Lets assume
213
- that the 3rd resource in the collection is an auto scaling
214
- group resource. We can isolate that resource for display:
215
-
216
- ```
217
- $ sfn inspect STACK -a "resources.all.at(2)"
218
- ```
219
-
220
- Note that the resources are an array, and we are using a zero
221
- based index. Now, this simply provides us with the information
222
- we already have seen. One of the handy features within the
223
- [miasma][miasma] library is the ability to expand supported resources.
224
- So, we can expand this resource:
225
-
226
- ```
227
- $ sfn inspect STACK -a "resources.all.at(2).expand"
228
- ```
229
-
230
- This will expand the resource instance and return the actual
231
- auto scaling group resource. The result will provide more detailed
232
- information about the scaling group. But, perhaps we are looking
233
- for the instances in this scaling group. The model instance we
234
- now have (`Miasma::Orchestration::Models::AutoScale::Group`)
235
- contains a `servers` attribute. The output lists the IDs of the
236
- instances, but we can expand those as well:
237
-
238
- ```
239
- $ sfn inspect STACK -a "resources.all.at(2).expand.servers.map(&:expand)"
240
- ```
241
-
242
- The attribute string will be minimally processed when proxying calls
243
- to the underlying models, which is why we are able to do ruby-ish
244
- style things.
245
-
246
- ## Chef Knife Integration
247
-
248
- This library will also provide `cloudformation` subcommands
249
- to knife.
250
-
251
- ### Configuration
252
-
253
- The easiest way to configure the plugin is via the
254
- `knife.rb` file. Credentials are the only configuration
255
- requirement, and the `Hash` provided is proxied to
256
- [Miasma][miasma]. All configuration options provided
257
- via the `sfn` command are allowed within the
258
- `knife[:cloudformation]` namespace:
259
-
260
- #### AWS
261
-
262
- ```ruby
263
- # .chef/knife.rb
264
-
265
- knife[:cloudformation][:credentials] = {
266
- :provider => :aws,
267
- :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
268
- :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
269
- :aws_region => ENV['AWS_REGION']
270
- }
271
- ```
272
-
273
- #### Rackspace
274
-
275
- ```ruby
276
- # .chef/knife.rb
277
-
278
- knife[:cloudformation][:credentials] = {
279
- :provider => :rackspace,
280
- :rackspace_username => ENV['RACKSPACE_USERNAME'],
281
- :rackspace_api_key => ENV['RACKSPACE_API_KEY'],
282
- :rackspace_region => ENV['RACKSPACE_REGION']
283
- }
284
- ```
285
-
286
- #### OpenStack
287
-
288
- ```ruby
289
- # .chef/knife.rb
290
-
291
- knife[:cloudformation][:credentials] = {
292
- :provider => :open_stack,
293
- :open_stack_username => ENV['OPENSTACK_USERNAME'],
294
- :open_stack_password => ENV['OPENSTACK_PASSWORD'],
295
- :open_stack_identity_url => ENV['OPENSTACK_IDENTITY_URL'],
296
- :open_stack_tenant_name => ENV['OPENSTACK_TENANT']
297
- }
298
- ```
299
-
300
- ### Usage
301
-
302
- All commands available via the `sfn` command are available as
303
- knife subcommands under `cloudformation` and `sparkleformation`
304
-
305
- ```
306
- $ knife cloudformation --help
307
- ```
308
-
309
- or
310
-
311
- ```
312
- $ knife sparkleformation --help
313
- ```
17
+ * [User Documentation](http://www.sparkleformation.io/docs/sfn/)
314
18
 
315
19
  # Info
316
20
 
@@ -158,9 +158,7 @@ module Sfn
158
158
  formation.compile_state = current_state
159
159
  end
160
160
  end
161
- sparkle_packs.each do |pack|
162
- sf.sparkle.add_sparkle(pack)
163
- end
161
+ sf.sparkle.apply sparkle_collection
164
162
  custom_stack_types.each do |s_type|
165
163
  unless(sf.stack_resource_types.include?(s_type))
166
164
  sf.stack_resource_types.push(s_type)
data/lib/sfn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Sfn
2
2
  # Current library version
3
- VERSION = Gem::Version.new('2.0.6')
3
+ VERSION = Gem::Version.new('2.1.0')
4
4
  end
data/sfn.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.add_runtime_dependency 'miasma-aws', '>= 0.2.0', '< 0.4'
16
16
  s.add_runtime_dependency 'miasma-azure', '>= 0.1.0', '< 0.3'
17
17
  s.add_runtime_dependency 'net-ssh'
18
- s.add_runtime_dependency 'sparkle_formation', '~> 2.0'
18
+ s.add_runtime_dependency 'sparkle_formation', '>= 2.1.2', '< 3'
19
19
  s.add_runtime_dependency 'hashdiff', '~> 0.2.2'
20
20
  s.add_development_dependency 'rake'
21
21
  s.add_development_dependency 'minitest'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
@@ -108,16 +108,22 @@ dependencies:
108
108
  name: sparkle_formation
109
109
  requirement: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - "~>"
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: 2.1.2
114
+ - - "<"
112
115
  - !ruby/object:Gem::Version
113
- version: '2.0'
116
+ version: '3'
114
117
  type: :runtime
115
118
  prerelease: false
116
119
  version_requirements: !ruby/object:Gem::Requirement
117
120
  requirements:
118
- - - "~>"
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 2.1.2
124
+ - - "<"
119
125
  - !ruby/object:Gem::Version
120
- version: '2.0'
126
+ version: '3'
121
127
  - !ruby/object:Gem::Dependency
122
128
  name: hashdiff
123
129
  requirement: !ruby/object:Gem::Requirement