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 +4 -4
- data/README.md +4 -2
- data/lib/capistrano-paratrooper-chef/chef.rb +17 -4
- data/lib/capistrano-paratrooper-chef/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4590b846a1a7a6109a2a3ab2636e488f7d5300a
|
4
|
+
data.tar.gz: 50a5c13c58a9cf446b1bf90132e9bd8c3ee1c38f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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, ["
|
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)
|
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')
|
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"] =
|
278
|
+
@librarian_env.config_db.local["path"] = vendor_cookbooks_path
|
266
279
|
@librarian_env
|
267
280
|
end
|
268
281
|
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.
|
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-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|