chef_cap 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -0
- data/lib/chef_cap/version.rb +1 -1
- data/recipes/rbenv.rb +6 -5
- data/recipes/ruby.rb +1 -1
- data/recipes/rvm.rb +9 -9
- data/spec/chef_cap_spec.rb +5 -1
- metadata +9 -9
data/README.rdoc
CHANGED
@@ -75,6 +75,18 @@ Optional JSON keys:
|
|
75
75
|
{ "rollback_run_list": [] }
|
76
76
|
{ "deploy_recipe": "[some_cookbook]::[some_recipe]" }
|
77
77
|
|
78
|
+
=== RVM/RBENV
|
79
|
+
|
80
|
+
You can set which ruby version switcher to use. RVM is the default. ruby_version can be set as well.
|
81
|
+
|
82
|
+
{
|
83
|
+
"environments": {
|
84
|
+
ENVIRONMENT: {
|
85
|
+
"ruby_version_switcher": "rvm",
|
86
|
+
"ruby_version": "1.9.3-p125"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
78
90
|
|
79
91
|
== REQUIREMENTS
|
80
92
|
|
data/lib/chef_cap/version.rb
CHANGED
data/recipes/rbenv.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
namespace :bootstrap do
|
2
2
|
desc "Create a standalone rbenv installation with a default ruby to use with chef-solo"
|
3
3
|
task :rbenv do
|
4
|
-
set :
|
5
|
-
set :rbenv_ruby_version,
|
4
|
+
set :ruby_version, (ChefDnaParser.parsed["environment"]["ruby_version"] rescue "ruby-1.9.3-p0" || "ruby-1.9.3-p0")
|
5
|
+
set :rbenv_ruby_version, ruby_version.gsub(/^ruby\-/,'')
|
6
6
|
standup_script = <<-SH
|
7
7
|
#!/bin/bash
|
8
8
|
#
|
@@ -11,9 +11,8 @@ namespace :bootstrap do
|
|
11
11
|
|
12
12
|
HAVE_RBENV_ALREADY=`which rbenv 2>/dev/null`
|
13
13
|
if [ $? != 0 ]; then
|
14
|
-
|
15
|
-
sudo yum install -y
|
16
|
-
|
14
|
+
echo "Install rbenv dependencies..."
|
15
|
+
sudo yum install -y git
|
17
16
|
echo "Building rbenv..."
|
18
17
|
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
|
19
18
|
# Add rbenv to your path
|
@@ -36,6 +35,8 @@ namespace :bootstrap do
|
|
36
35
|
# Install Ruby #{rbenv_ruby_version}
|
37
36
|
HAVE_CORRECT_VERSION=`rbenv versions | grep '#{rbenv_ruby_version}' | wc -l`
|
38
37
|
if [ $HAVE_CORRECT_VERSION -eq 0 ]; then
|
38
|
+
echo "Installing Ruby dependencies..."
|
39
|
+
sudo yum install -y automake gcc make libtool curl zlib zlib-devel patch readline readline-devel libffi-devel openssl openssl-devel
|
39
40
|
echo "Installing #{rbenv_ruby_version}..."
|
40
41
|
rbenv install #{rbenv_ruby_version}
|
41
42
|
rbenv global #{rbenv_ruby_version}
|
data/recipes/ruby.rb
CHANGED
@@ -2,7 +2,7 @@ namespace :bootstrap do
|
|
2
2
|
desc "Create a standalone rbenv installation with a default ruby to use with chef-solo"
|
3
3
|
task :ruby do
|
4
4
|
local_rvs = ruby_version_switcher rescue 'rvm'
|
5
|
-
local_env = rails_env rescue '
|
5
|
+
local_env = rails_env rescue 'unknown'
|
6
6
|
|
7
7
|
case local_rvs
|
8
8
|
when 'rbenv'
|
data/recipes/rvm.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :bootstrap do
|
2
2
|
desc "Create a standalone rvm installation with a default ruby to use with chef-solo"
|
3
3
|
task :rvm do
|
4
|
-
set :
|
4
|
+
set :ruby_version, (ChefDnaParser.parsed["environment"]["ruby_version"] rescue "ruby-1.9.3-p0" || "ruby-1.9.3-p0")
|
5
5
|
rvm_standup_script = <<-SH
|
6
6
|
#!/bin/bash
|
7
7
|
#
|
@@ -14,14 +14,14 @@ namespace :bootstrap do
|
|
14
14
|
which rvm > /tmp/.chef_cap_rvm_path
|
15
15
|
`cat /tmp/.chef_cap_rvm_path` list | grep "No rvm rubies installed"
|
16
16
|
if [ $? -eq 0 ]; then
|
17
|
-
echo "No rvm rubies installed. Installing from capistrano setting :
|
18
|
-
`cat /tmp/.chef_cap_rvm_path` install #{
|
19
|
-
`cat /tmp/.chef_cap_rvm_path` --default use #{
|
17
|
+
echo "No rvm rubies installed. Installing from capistrano setting :ruby_version #{ruby_version}"
|
18
|
+
`cat /tmp/.chef_cap_rvm_path` install #{ruby_version}
|
19
|
+
`cat /tmp/.chef_cap_rvm_path` --default use #{ruby_version}
|
20
20
|
fi
|
21
21
|
`cat /tmp/.chef_cap_rvm_path` list | grep "Default ruby not set"
|
22
22
|
if [ $? -eq 0 ]; then
|
23
23
|
echo "No rvm default set."
|
24
|
-
`cat /tmp/.chef_cap_rvm_path` alias create default #{
|
24
|
+
`cat /tmp/.chef_cap_rvm_path` alias create default #{ruby_version}
|
25
25
|
fi
|
26
26
|
exit 0
|
27
27
|
else
|
@@ -39,10 +39,10 @@ namespace :bootstrap do
|
|
39
39
|
which rvm > /tmp/.chef_cap_rvm_path
|
40
40
|
`cat /tmp/.chef_cap_rvm_path` list | grep "No rvm rubies installed"
|
41
41
|
if [ $? -eq 0 ]; then
|
42
|
-
echo "No rvm rubies installed. Installing from capistrano setting :
|
43
|
-
`cat /tmp/.chef_cap_rvm_path` install #{
|
44
|
-
`cat /tmp/.chef_cap_rvm_path` --default use #{
|
45
|
-
`cat /tmp/.chef_cap_rvm_path` alias create default #{
|
42
|
+
echo "No rvm rubies installed. Installing from capistrano setting :ruby_version #{ruby_version}"
|
43
|
+
`cat /tmp/.chef_cap_rvm_path` install #{ruby_version}
|
44
|
+
`cat /tmp/.chef_cap_rvm_path` --default use #{ruby_version}
|
45
|
+
`cat /tmp/.chef_cap_rvm_path` alias create default #{ruby_version}
|
46
46
|
fi
|
47
47
|
else
|
48
48
|
echo "FATAL ERROR: I have no idea how to download RVM without curl!"
|
data/spec/chef_cap_spec.rb
CHANGED
@@ -47,7 +47,10 @@ describe "chef_cap" do
|
|
47
47
|
},
|
48
48
|
"environments": {
|
49
49
|
"defaults": {
|
50
|
-
"user": "myuser"
|
50
|
+
"user": "myuser",
|
51
|
+
"ruby": {
|
52
|
+
"version": "1.9.2-HEAD"
|
53
|
+
}
|
51
54
|
},
|
52
55
|
"some_env": {
|
53
56
|
"user": "newenvuser",
|
@@ -66,6 +69,7 @@ describe "chef_cap" do
|
|
66
69
|
chef_cap.cap_variable[:repository].should == "git@somehost:user/repo.git"
|
67
70
|
chef_cap.cap_variable[:scm].should == :git
|
68
71
|
chef_cap.cap_variable[:user].should == "myuser"
|
72
|
+
chef_cap.cap_variable[:ruby_version].should == "1.9.2-HEAD"
|
69
73
|
|
70
74
|
chef_cap.cap_variable[:rails_env].should be_nil
|
71
75
|
chef_cap.cap_task[:some_env].should_not be_nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_cap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &2239810400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.5.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2239810400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &2239809900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.1'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2239809900
|
36
36
|
description: chef_cap uses chef"s JSON config format to drive both capistrano and
|
37
37
|
chef-solo"
|
38
38
|
email:
|
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
segments:
|
95
95
|
- 0
|
96
|
-
hash:
|
96
|
+
hash: 2890703575138462946
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
@@ -102,10 +102,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
segments:
|
104
104
|
- 0
|
105
|
-
hash:
|
105
|
+
hash: 2890703575138462946
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.8.
|
108
|
+
rubygems_version: 1.8.15
|
109
109
|
signing_key:
|
110
110
|
specification_version: 3
|
111
111
|
summary: capistrano + chef-solo == chef_cap"
|