batali 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd8679efebec3984ad2b5e8155ca72f3e2f17445
4
- data.tar.gz: cc7ee3d73c0e7a9fb7c331005d61095ceecd9fbb
3
+ metadata.gz: e09935acfcbc04835f428e88c65c46d5effbc164
4
+ data.tar.gz: 5d9b81aacd71727b823947a744a050962908e197
5
5
  SHA512:
6
- metadata.gz: 0051b4f1cfbd04e1eb9d7b709c52ead0e5b9ef16077d5a6308e7b6c7d7412e320c47b4efef5c833be210582e837d38382ce334e5cccc6f19cd6f41841e6a1b71
7
- data.tar.gz: 94b780e0299a7e759912694a2a1aafd78b3bf4cd86d9d63616ca75018808dac39c4ca3a28cf6d8febd38047af7fd5fb70ed93d16a00aab9d2b221039cd94b589
6
+ metadata.gz: cfa3f9193ac35a32b7d467d4f46dbc687c67e944f8ae0ffc95d5ca952d8613a93dde468af54a7310004677ed177cb78f44f581f6135c53899b64ad4e60af60c6
7
+ data.tar.gz: 05a5d1eff7e95a0b584a52f1a3e2ca38a17511a17dd5641f8256a8627027368e9db748df7be50b9078f6f43f2819ab0abcbc96a472b8fbe76915c095fe2b2565
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.2.8
2
+ * Include missing infrastructure configuration flag on install command
3
+ * Default the cache directory to home directory to isolate users
4
+ * Add support for configuration file
5
+
1
6
  # v0.2.6
2
7
  * Add support for ChefSpec
3
8
 
data/README.md CHANGED
@@ -202,6 +202,122 @@ $ batali resolve --infrastructure
202
202
 
203
203
  _NOTE: Depending on constraints defined within the Batali file, this can be a very large manifest_
204
204
 
205
+ #### Uploading infrastructure cookbooks
206
+
207
+ When the infrastructure cookbooks are installed locally, the cookbook directories will have
208
+ the version number as a suffix. This can cause a problem when attempting to run:
209
+
210
+ ```
211
+ $ knife cookbook upload --all
212
+ ```
213
+
214
+ due to knife using the directory name as the actual cookbook name. To get around this problem
215
+ the `upload` command can be used directly with the correct options enabled. These options must
216
+ be defined within the config file as the options are not accessible via CLI flags. Assuming
217
+ a `.chef/knife.rb` file exists:
218
+
219
+ ```ruby
220
+ # .chef/knife.rb
221
+
222
+ versioned_cookbooks true
223
+ ```
224
+
225
+ ```
226
+ $ knife upload cookbooks
227
+ ```
228
+
229
+ ### Display outdated cookbooks
230
+
231
+ Want to see what cookbooks have newer versions available within the defined constraints? Use
232
+ the dry run option to see what upgrades are available without actually changing the manifest:
233
+
234
+ ```
235
+ $ batali resolve --no-least-impact --dry-run
236
+ ```
237
+
238
+ ## Configuration
239
+
240
+ Batali can be configured via the `.batali` file. The contents of the file can be in YAML,
241
+ JSON, XML, or Ruby. Every option displayed via the help call can be set within this file.
242
+ The configuration can hold items isolated within a command's name, or defined at the top
243
+ level of the configuration file. For example:
244
+
245
+ ```ruby
246
+ Configuration.new do
247
+ debug true
248
+ resolve do
249
+ debug false
250
+ end
251
+ end
252
+ ```
253
+
254
+ This configuration turns debug output on for all commands _except_ the resolve command.
255
+ This feature is handy in situations where multiple commands may have the same flag that
256
+ should always be enabled, like the `infrastructure` flag:
257
+
258
+ ```ruby
259
+ Configuration.new do
260
+ infrastructure true
261
+ end
262
+ ```
263
+
264
+ When flags on the CLI contain a dash, they are referenced within the configuration file
265
+ as an underscore. For example the least impact flag on the CLI looks like:
266
+
267
+ ```
268
+ --least-impact
269
+ ```
270
+
271
+ and the key in the configuration looks like:
272
+
273
+ ```
274
+ least_impact
275
+ ```
276
+
277
+ ### Example configurations
278
+
279
+ #### Ruby
280
+
281
+ ```ruby
282
+ Configuration.new do
283
+ infrastructure true
284
+ resolve do
285
+ least_impact false
286
+ end
287
+ end
288
+ ```
289
+
290
+ #### JSON
291
+
292
+ ```json
293
+ {
294
+ "infrastructure": true,
295
+ "resolve": {
296
+ "least_impact": false
297
+ }
298
+ }
299
+ ```
300
+
301
+ #### YAML
302
+
303
+ ```yaml
304
+ ---
305
+ :infrastructure: true
306
+ :resolve:
307
+ :least_impact: false
308
+ ```
309
+
310
+ #### XML
311
+
312
+ ```xml
313
+ <configuration>
314
+ <infrastructure>true</infrastructure>
315
+ <resolve>
316
+ <least_impact>false</least_impact>
317
+ </resolve>
318
+ </configuration>
319
+ ```
320
+
205
321
  ## Test Kitchen
206
322
 
207
323
  Batali can be used with [Test Kitchen](https://github.com/test-kitchen/test-kitchen):
data/batali.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.add_runtime_dependency 'attribute_struct', '~> 0.2.14'
14
14
  s.add_runtime_dependency 'grimoire', '~> 0.2.1'
15
15
  s.add_runtime_dependency 'bogo', '~> 0.1.18'
16
- s.add_runtime_dependency 'bogo-cli', '~> 0.1.12'
16
+ s.add_runtime_dependency 'bogo-cli', '~> 0.1.18'
17
17
  s.add_runtime_dependency 'bogo-config', '~> 0.1.10'
18
18
  s.add_runtime_dependency 'bogo-ui', '~> 0.1.6'
19
19
  s.add_runtime_dependency 'http', '~> 0.8.2'
data/bin/batali CHANGED
@@ -21,6 +21,7 @@ Bogo::Cli::Setup.define do
21
21
  self.instance_exec(&global_opts)
22
22
  on :d, 'dry-run', 'Print changes'
23
23
  on :p, 'path', 'Cookbook install path'
24
+ on :I, 'infrastructure', 'Resolve infrastructure cookbooks'
24
25
  run do |opts, args|
25
26
  Batali::Command::Install.new({:install => opts.to_hash}, args).execute!
26
27
  end
@@ -29,7 +29,7 @@ module Batali
29
29
  :system => system,
30
30
  :score_keeper => score_keeper
31
31
  )
32
- if(opts[:infrastructure])
32
+ if(config[:infrastructure])
33
33
  infrastructure_resolution(solv)
34
34
  else
35
35
  single_path_resolution(solv)
@@ -40,7 +40,7 @@ module Batali
40
40
  def score_keeper
41
41
  memoize(:score_keeper) do
42
42
  sk_manifest = Manifest.new(:cookbook => manifest.cookbook)
43
- unless(opts[:least_impact])
43
+ unless(config[:least_impact])
44
44
  sk_manifest.cookbook.clear
45
45
  end
46
46
  sk_manifest.cookbook.delete_if do |unit|
@@ -62,7 +62,7 @@ module Batali
62
62
  ]
63
63
  ui.info 'Performing single path resolution.'
64
64
  if(manifest.infrastructure)
65
- ui.ask 'Current manifest is resolved for infrastucture. Convert to single path?'
65
+ ui.confirm 'Current manifest is resolved for infrastucture. Convert to single path?'
66
66
  end
67
67
  results = []
68
68
  run_action 'Resolving dependency constraints' do
@@ -5,6 +5,8 @@ module Batali
5
5
  # Customized command base for Batali
6
6
  class Command < Bogo::Cli::Command
7
7
 
8
+ DEFAULT_CONFIGURATION_FILES = ['.batali']
9
+
8
10
  include Bogo::Memoization
9
11
 
10
12
  autoload :Configure, 'batali/command/configure'
@@ -44,7 +46,7 @@ module Batali
44
46
  # @return [String] path to local cache
45
47
  def cache_directory(*args)
46
48
  memoize(['cache_directory', *args].join('_')) do
47
- directory = config.fetch(:cache_directory, '/tmp/batali-cache')
49
+ directory = config.fetch(:cache_directory, File.expand_path('~/.batali/cache'))
48
50
  ui.debug "Cache directory to persist cookbooks: #{directory}"
49
51
  unless(args.empty?)
50
52
  directory = File.join(directory, *args.map(&:to_s))
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.2.6')
3
+ VERSION = Gem::Version.new('0.2.8')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batali
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
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-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.12
61
+ version: 0.1.18
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.12
68
+ version: 0.1.18
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bogo-config
71
71
  requirement: !ruby/object:Gem::Requirement