chef_cap 0.1.8 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -5
- data/chef_cap.gemspec +2 -1
- data/lib/chef_cap/version.rb +1 -1
- data/recipes/chef_cap.rb +8 -1
- data/spec/chef_cap_spec.rb +4 -3
- metadata +15 -16
data/Gemfile
CHANGED
data/chef_cap.gemspec
CHANGED
@@ -10,10 +10,11 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["casecommons-dev@googlegroups.com"]
|
11
11
|
s.homepage = "https://github.com/Casecommons/chef_cap"
|
12
12
|
s.license = "MIT"
|
13
|
-
s.add_dependency('capistrano', '>= 2.5.5')
|
14
13
|
s.summary = %q{capistrano + chef-solo == chef_cap"}
|
15
14
|
s.description = %q{chef_cap uses chef"s JSON config format to drive both capistrano and chef-solo"}
|
16
15
|
|
16
|
+
s.add_dependency('capistrano', '>= 2.5.5')
|
17
|
+
s.add_development_dependency('rspec-rails', '>= 2.1')
|
17
18
|
s.files = `git ls-files`.split("\n")
|
18
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/lib/chef_cap/version.rb
CHANGED
data/recipes/chef_cap.rb
CHANGED
@@ -139,10 +139,17 @@ else
|
|
139
139
|
raise DnaConfigurationError, "Could not find cookbooks in JSON or as a subdirectory of where your JSON is!"
|
140
140
|
end
|
141
141
|
|
142
|
+
if ChefDnaParser.parsed["chef"] && ChefDnaParser.parsed["chef"]["version"]
|
143
|
+
set :chef_version, ChefDnaParser.parsed["chef"]["version"]
|
144
|
+
else
|
145
|
+
default_chef_version = "0.9.16"
|
146
|
+
set :chef_version, default_chef_version
|
147
|
+
end
|
148
|
+
|
142
149
|
namespace :chef do
|
143
150
|
desc "Setup chef solo on the server(s)"
|
144
151
|
task :setup do
|
145
|
-
gem_check_for_chef_cmd = "gem specification --version '
|
152
|
+
gem_check_for_chef_cmd = "gem specification --version '>=#{chef_version}' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }'"
|
146
153
|
install_chef_cmd = "sudo rvm default exec gem install chef --no-ri --no-rdoc"
|
147
154
|
sudo "rvm default exec #{gem_check_for_chef_cmd} || #{install_chef_cmd} && echo 'Chef Solo already on this server.'"
|
148
155
|
sudo "rvm default exec which chef-solo"
|
data/spec/chef_cap_spec.rb
CHANGED
@@ -365,7 +365,8 @@ describe "chef_cap" do
|
|
365
365
|
@test_dna = <<-JS
|
366
366
|
{
|
367
367
|
"chef": {
|
368
|
-
"root": "path_to_cookbooks"
|
368
|
+
"root": "path_to_cookbooks",
|
369
|
+
"version": "0.1982.1234"
|
369
370
|
},
|
370
371
|
"environments": {
|
371
372
|
"some_env": {
|
@@ -419,7 +420,7 @@ describe "chef_cap" do
|
|
419
420
|
server_session.things_that_were_set["node_hash_for_localhost"].should == {
|
420
421
|
"environments" => {"some_env"=>{ "rails_env" => "myenv",
|
421
422
|
"servers"=>[ {"hostname"=>"localhost", "roles"=>["role1", "role2"] }, {"hostname"=>"otherhost.com", "roles"=>["role1"]}]}},
|
422
|
-
"chef" => {"root"=>"path_to_cookbooks"},
|
423
|
+
"chef" => {"root"=>"path_to_cookbooks", "version"=>"0.1982.1234"},
|
423
424
|
"run_list" => ["foo", "bar"],
|
424
425
|
"environment" => {"rails_env" => "myenv", "servers"=>[ {"primary" => [], "hostname"=>"localhost", "roles"=>["role1", "role2"] },
|
425
426
|
{"primary" => [], "hostname"=>"otherhost.com", "roles"=>["role1"]}]},
|
@@ -472,7 +473,7 @@ describe "chef_cap" do
|
|
472
473
|
|
473
474
|
it "sets up chef gem" do
|
474
475
|
chef_cap.cap_servers.should_not be_empty
|
475
|
-
chef_cap.should_receive(:sudo).ordered.with("rvm default exec gem specification --version '>=0.
|
476
|
+
chef_cap.should_receive(:sudo).ordered.with("rvm default exec gem specification --version '>=0.1982.1234' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }' || sudo rvm default exec gem install chef --no-ri --no-rdoc && echo 'Chef Solo already on this server.'").and_return("mocked")
|
476
477
|
chef_cap.should_receive(:sudo).ordered.with("rvm default exec which chef-solo").and_return("mocked")
|
477
478
|
chef_cap.cap_task["chef:setup"].call
|
478
479
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_cap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 8
|
9
|
-
version: 0.1.8
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Case Commons, LLC
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-06-10 00:00:00 -04:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,13 +21,20 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 2
|
30
|
-
- 5
|
31
|
-
- 5
|
32
24
|
version: 2.5.5
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec-rails
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "2.1"
|
36
|
+
type: :development
|
37
|
+
version_requirements: *id002
|
35
38
|
description: chef_cap uses chef"s JSON config format to drive both capistrano and chef-solo"
|
36
39
|
email:
|
37
40
|
- casecommons-dev@googlegroups.com
|
@@ -91,21 +94,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
94
|
requirements:
|
92
95
|
- - ">="
|
93
96
|
- !ruby/object:Gem::Version
|
94
|
-
segments:
|
95
|
-
- 0
|
96
97
|
version: "0"
|
97
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
99
|
none: false
|
99
100
|
requirements:
|
100
101
|
- - ">="
|
101
102
|
- !ruby/object:Gem::Version
|
102
|
-
segments:
|
103
|
-
- 0
|
104
103
|
version: "0"
|
105
104
|
requirements: []
|
106
105
|
|
107
106
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.
|
107
|
+
rubygems_version: 1.6.2
|
109
108
|
signing_key:
|
110
109
|
specification_version: 3
|
111
110
|
summary: capistrano + chef-solo == chef_cap"
|