capistrano-paratrooper-chef 0.4.0 → 0.4.1

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: 1709b90a60e5e58f7b058244cb5e984ee5b3d6c0
4
- data.tar.gz: 706ca5d5aa700e596b6a83957747f7306db6de46
3
+ metadata.gz: b4590b846a1a7a6109a2a3ab2636e488f7d5300a
4
+ data.tar.gz: 50a5c13c58a9cf446b1bf90132e9bd8c3ee1c38f
5
5
  SHA512:
6
- metadata.gz: f7691d026c82465560421fbccbfd2db1e964a1716824be9ec631ae2566e3f78530a7cac017ebb57a25647e6aa8bed27cba9080000e081d7a84f47f66ec186565
7
- data.tar.gz: 1a362311ae34da0fa56ed2c64c7be8bf0a3b084072f54449034b86871ce33a82421da27ca4d63ae04c225229ef0ab0f927688fd76f09d06ae528f4aa8fd4ffd1
6
+ metadata.gz: d5955f75d2567e37d8c7bf35cf85044a3eb8f332c0ea3ba4e6d82ab7a3be40d22aa6d7032edca932f861e02329feb8eb1889faafc1a7cddd6697822525be3897
7
+ data.tar.gz: 0c87ad33f5c47362fe99349921b0b19a1c965daa8e22f056737e5dce764fb8bc39aae30aebb35a0fc52e5554b82adf2ae35718326bba80d62d1cd5e78254d907
data/README.md CHANGED
@@ -29,8 +29,9 @@ To setup paratrooper-chef for your application, add following in you config/depl
29
29
  And then, put your chef-kitchen files to config/ directory.
30
30
  by default, paratrooper-chef uses following files and directories.
31
31
 
32
+ * config/Berksfile
33
+ * config/Cheffile
32
34
  * config/solo.rb
33
- * config/cookbooks
34
35
  * config/site-cookbooks
35
36
  * config/roles
36
37
  * config/environments
@@ -120,7 +121,8 @@ Following options are available.
120
121
 
121
122
  * `:chef_kitchen_path` - root directory of kitchen. use `config` by default.
122
123
  * `:chef_default_solo_json_path` - default attribute file a.k.a solo.json. use `solo.json` by default.
123
- * `:chef_cookbooks_path` - cookbooks directories list. use `["cookbooks", "site-cookbooks"]` by default.
124
+ * `:chef_cookbooks_path` - cookbooks directory (or list of directories). use `site-cookbooks` by default.
125
+ * `:chef_vendor_cookbooks_path` - cookbooks directory for berkshelf/librarian. use `vendor/cookbooks` by default.
124
126
  * `:chef_nodes_path` - nodes directory. use `nodes` by default.
125
127
  * `:chef_roles_path` - roles directory. use `roles` by default.
126
128
  * `:chef_environment` - environment setting. empty by default.
@@ -26,7 +26,8 @@ Capistrano::Configuration.instance.load do
26
26
  set :chef_kitchen_path, "config"
27
27
  set :chef_default_solo_json_path, "solo.json"
28
28
  set :chef_nodes_path, "nodes"
29
- set :chef_cookbooks_path, ["cookbooks", "site-cookbooks"]
29
+ set :chef_cookbooks_path, ["site-cookbooks"]
30
+ set :chef_vendor_cookbooks_path, "vendor/cookbooks"
30
31
  set :chef_roles_path, "roles"
31
32
  set :chef_environment, nil
32
33
  set :chef_environment_path, "environments"
@@ -82,7 +83,12 @@ Capistrano::Configuration.instance.load do
82
83
  end
83
84
 
84
85
  def cookbooks_paths
85
- fetch(:chef_cookbooks_path).collect{|path| File.join(fetch(:chef_kitchen_path), path)}
86
+ dirs = [fetch(:chef_cookbooks_path), fetch(:chef_vendor_cookbooks_path)].flatten
87
+ dirs.collect{|path| File.join(fetch(:chef_kitchen_path), path)}
88
+ end
89
+
90
+ def vendor_cookbooks_path
91
+ File.join(fetch(:chef_kitchen_path), fetch(:chef_vendor_cookbooks_path))
86
92
  end
87
93
 
88
94
  def roles_path
@@ -239,7 +245,14 @@ Capistrano::Configuration.instance.load do
239
245
 
240
246
  if File.exist? 'Berksfile'
241
247
  logger.debug("executing berkshelf")
242
- Berkshelf::Berksfile.from_file('Berksfile').install(:path => cookbooks_paths[0])
248
+ berksfile = Berkshelf::Berksfile.from_file('Berksfile')
249
+ if berksfile.respond_to?(:vendor)
250
+ FileUtils.rm_rf(vendor_cookbooks_path)
251
+ FileUtils.mkdir_p(File.dirname(vendor_cookbooks_path))
252
+ berksfile.vendor(vendor_cookbooks_path)
253
+ else
254
+ berksfile.install(:path => vendor_cookbooks_path)
255
+ end
243
256
  end
244
257
  rescue LoadError
245
258
  # pass
@@ -262,7 +275,7 @@ Capistrano::Configuration.instance.load do
262
275
 
263
276
  def librarian_env
264
277
  @librarian_env ||= Librarian::Chef::Environment.new
265
- @librarian_env.config_db.local["path"] = cookbooks_paths[0]
278
+ @librarian_env.config_db.local["path"] = vendor_cookbooks_path
266
279
  @librarian_env
267
280
  end
268
281
  end
@@ -16,7 +16,7 @@
16
16
  module Capistrano
17
17
  module Paratrooper
18
18
  module Chef
19
- VERSION = "0.4.0"
19
+ VERSION = "0.4.1"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-paratrooper-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi KOMIYA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-03 00:00:00.000000000 Z
11
+ date: 2013-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano