batali 0.1.20 → 0.1.22

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: eadd48fc1341e54688813b18a73d6eb13284451c
4
- data.tar.gz: 84b62f74c35cd576c3c32aaea40beed4bb082eb4
3
+ metadata.gz: dbea03b20a8f3a778cf33c5419052e6287d03fa6
4
+ data.tar.gz: 31cb700a57303625a7b153d7cd337d697ddbcaff
5
5
  SHA512:
6
- metadata.gz: d9452d064ef4c452098319d76e0f1708b7a962977b5ef8b41d3c513aa7895c5c484413c41b1342eb602242adda92a80140a0c1a792b6a0e98c20a70d6ee562b9
7
- data.tar.gz: f330d2af6d5e897fe4604ac7e2ea855a5f6c8e7d1b922fb989030de6ba5bad3c6ed1c26b577f99681ea93d762c9375b3ffa94afa5806e692b16edf86b674f835
6
+ metadata.gz: 8cb20016cc7b46f91cc629020b50e5661c16ad0c81ebdb56beeb64d9bbef012973937e9bb8844197278a819b75a52072cc38db4f96f831bea0a12b79bbbc1ded
7
+ data.tar.gz: 78b4188b71cbeaaccf38a244ecc2c31ec134485aca8974bbf527d15f747c15a96da8a02a31adaba58fd07a427f53207edc0eb1b15432ed4beffaf6f1c9230ecf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.1.22
2
+ * Add support for `metadata` keyword in Batali file
3
+ * Extract install path from merged config instead of only namespaced opts
4
+
1
5
  # v0.1.20
2
6
  * Reuse ui on `update` command when calling `resolve` and `install`
3
7
 
data/README.md CHANGED
@@ -194,6 +194,12 @@ $ batali resolve --infrastructure
194
194
 
195
195
  _NOTE: Depending on constraints defined within the Batali file, this can be a very large manifest_
196
196
 
197
+ ## Test Kitchen
198
+
199
+ Batali can be used with [Test Kitchen](https://github.com/test-kitchen/test-kitchen):
200
+
201
+ * https://github.com/hw-labs/batali-tk
202
+
197
203
  # Info
198
204
 
199
205
  * Repository: https://github.com/hw-labs/batali
data/lib/batali/b_file.rb CHANGED
@@ -31,6 +31,10 @@ module Batali
31
31
  self
32
32
  end
33
33
 
34
+ def metadata(*args)
35
+ set!(:metadata, *(args.empty? ? [true] : args))
36
+ end
37
+
34
38
  end
35
39
 
36
40
  # Create a new file
@@ -92,6 +96,13 @@ module Batali
92
96
  }
93
97
  attribute :group, Group, :multiple => true, :coerce => lambda{|v| Group.new()}
94
98
  attribute :cookbook, Cookbook, :multiple => true, :coerce => BFile.cookbook_coerce, :default => []
99
+ attribute :metadata, Cookbook, :coerce => lambda{ |v, b_file|
100
+ dir = File.dirname(b_file.path)
101
+ m_unit = Origin::Path.new(:name => 'metadata', :path => dir).units.first
102
+ ckbk = Cookbook.new(:name => m_unit.name, :version => m_unit.version, :path => dir)
103
+ b_file.cookbook.push ckbk
104
+ ckbk
105
+ }
95
106
 
96
107
  end
97
108
 
@@ -10,7 +10,7 @@ module Batali
10
10
  # Install cookbooks
11
11
  def execute!
12
12
  dry_run('Cookbook installation') do
13
- install_path = opts.fetch(:path, 'cookbooks')
13
+ install_path = config.fetch(:path, 'cookbooks')
14
14
  run_action('Readying installation destination') do
15
15
  FileUtils.rm_rf(install_path)
16
16
  FileUtils.mkdir_p(install_path)
@@ -27,13 +27,14 @@ module Batali
27
27
  )
28
28
  end
29
29
  asset_path = unit.source.asset
30
+ final_path = File.join(install_path, unit.name)
31
+ if(config[:infrastructure])
32
+ final_path << "-#{unit.version}"
33
+ end
30
34
  begin
31
35
  FileUtils.cp_r(
32
36
  File.join(asset_path, '.'),
33
- File.join(
34
- install_path,
35
- "#{unit.name}-#{unit.version}"
36
- )
37
+ final_path
37
38
  )
38
39
  ensure
39
40
  unit.source.clean_asset(asset_path)
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.1.20')
3
+ VERSION = Gem::Version.new('0.1.22')
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.1.20
4
+ version: 0.1.22
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-03-24 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct