capistrano-paratrooper-chef 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -45,10 +45,18 @@ Finally, run capistrano with paratrooper:chef task. Then chef-solo runs at remot
45
45
  Paratrooper-chef includes another task to setup chef-solo to remote hosts.
46
46
  To enable it, add following in your config/deploy.rb.
47
47
 
48
+ # in "config/deploy.rb"
49
+ require "capistrano-paratrooper-chef/omnibus_install"
50
+
51
+ This recipe will install chef-solo using omnibus-installer during deploy:setup task.
52
+
53
+ Another way, you want to install chef-solo as gem package, use following lines.
54
+
48
55
  # in "config/deploy.rb"
49
56
  require "capistrano-paratrooper-chef/install"
50
57
 
51
- This recipe will install chef-solo during deploy:setup task.
58
+ This recipe will install chef-solo using gem command during deploy:setup task.
59
+ Of cource, capistrano-paratrooper-chef/install requires ruby and rubygems are available.
52
60
 
53
61
  ## Define attributes for specific host
54
62
 
@@ -122,6 +130,14 @@ Following recipes work fine with paratrooper-chef.
122
130
  * rvm-capistrano (https://github.com/wayneeseguin/rvm-capistrano)
123
131
  * capistrano-rbenv (https://github.com/yyuu/capistrano-rbenv)
124
132
 
133
+ ## Support cookbooks manager
134
+
135
+ Following cookbooks managers work fine with paratrooper-chef.
136
+
137
+ * librarian-chef (https://github.com/applicationsonline/librarian-chef)
138
+
139
+ paratrooper-chef try to fetch cookbooks using these managers.
140
+
125
141
  ## Contributing
126
142
 
127
143
  1. Fork it
@@ -187,6 +187,27 @@ Capistrano::Configuration.instance.load do
187
187
  end
188
188
 
189
189
  namespace :kitchen do
190
+ namespace :librarian_chef do
191
+ def fetch
192
+ require 'librarian/action'
193
+ require 'librarian/chef'
194
+
195
+ if File.exist? 'Cheffile'
196
+ logger.debug("executing librarian-chef")
197
+ Librarian::Action::Resolve.new(librarian_env).run
198
+ Librarian::Action::Install.new(librarian_env).run
199
+ end
200
+ rescue LoadError
201
+ # pass
202
+ end
203
+
204
+ def librarian_env
205
+ @librarian_env ||= Librarian::Chef::Environment.new
206
+ @librarian_env.config_db.local["path"] = cookbooks_paths[0]
207
+ @librarian_env
208
+ end
209
+ end
210
+
190
211
  def ensure_cookbooks
191
212
  abort "No cookbooks found in #{fetch(:cookbooks_directory).inspect}" if kitchen.cookbooks_paths.empty?
192
213
  end
@@ -198,6 +219,8 @@ Capistrano::Configuration.instance.load do
198
219
 
199
220
  desc "Upload files in kitchen"
200
221
  task :upload, :except => { :no_release => true } do
222
+ librarian_chef.fetch
223
+
201
224
  kitchen_paths = [cookbooks_paths, roles_path, databags_path].flatten.compact.select{|d| File.exists?(d)}
202
225
  tarball = Tempfile.new("kitchen.tar")
203
226
  begin
@@ -0,0 +1,13 @@
1
+ require 'capistrano-paratrooper-chef'
2
+
3
+ Capistrano::Configuration.instance.load do
4
+ namespace :paratrooper do
5
+ namespace :chef do
6
+ desc "Installs chef (by omnibus installer)"
7
+ task :install_omnibus_chef do
8
+ run "curl -L http://www.opscode.com/chef/install.sh | #{top.sudo} bash"
9
+ end
10
+ after "deploy:setup" "paratrooper:chef:install_omnibus_chef"
11
+ end
12
+ end
13
+ end
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Paratrooper
3
3
  module Chef
4
- VERSION = "0.0.3"
4
+ VERSION = "0.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-paratrooper-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-25 00:00:00.000000000 Z
12
+ date: 2013-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -42,6 +42,7 @@ files:
42
42
  - capistrano-paratrooper-chef.gemspec
43
43
  - lib/capistrano-paratrooper-chef.rb
44
44
  - lib/capistrano-paratrooper-chef/install.rb
45
+ - lib/capistrano-paratrooper-chef/omnibus_install.rb
45
46
  - lib/capistrano-paratrooper-chef/version.rb
46
47
  homepage: https://github.com/tk0miya/capistrano-paratrooper-chef
47
48
  licenses: []