capistrano-rvm 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +8 -1
- data/README.md +7 -17
- data/capistrano-rvm.gemspec +3 -2
- data/lib/capistrano/tasks/rvm.rake +17 -33
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDRmOWY5NjI3Yjk0NTgyODJhY2M3MWQ5MzFkM2UwNzI4M2U0ZTliMw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3aeff623f14eea33b115ccaa66e8f4c53b50278d
|
4
|
+
data.tar.gz: 9e291648b638dbfc8f6894fbaac223d1c6c1c827
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
Y2NlNjExYjJmMzk5NGYxMGMwZTVjODIyMjU2YTFiNzc1ZGM1ZjBmYzg5MGUy
|
11
|
-
YjgwYTkwM2E2MDY3M2Y3Y2UxMmQyNWRkNWVkYjE4NjNkZjY4ZWU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTBmMzFlNTEyODgyODNhNzU0NTQyNTY1MWVhYmYyNmY3Njk4MTM5MzhhZTZk
|
14
|
-
OTdiMTFiYTExMzI2Y2RhODIyZTRjZDg4N2E1NjhjZjExZjhiZTAwODMzMmQ2
|
15
|
-
M2QyZmFiYmU3NGI5NGE2MGM4YTRkMGExODQzNmM2ZDg5YjczYmY=
|
6
|
+
metadata.gz: e4d0d9d9745a67fb213cab704ce45eabd2145fdf7c4b5fbe40a58de28569b867efc4d331f257a407cc9555d8403b5e48ee242014725b4e2e5404b19f445ebd09
|
7
|
+
data.tar.gz: b59c20f09ee09d9adb01994464200d480f2d29338e49449f47ed87f681391133f32a72fe9e45560339b45769877e14666f3241f98555a8128b6cf63783fbe9b4
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
## 0.1.0
|
2
|
+
|
3
|
+
* User rvm is prefered over system (@mpapis)
|
4
|
+
* Switching to new command map (https://github.com/capistrano/sshkit/pull/45)
|
5
|
+
This gives us more flexible integration and command mapping.
|
6
|
+
Fixed bug when `cap some_task` didn't invoke RVM hooks.
|
7
|
+
|
1
8
|
## 0.0.3
|
2
9
|
Switching to detect the binaries at runtime using `rvm ruby do binary` (thanks to @mpapis!)
|
3
10
|
|
4
11
|
## 0.0.2
|
5
12
|
|
6
|
-
Initial release
|
13
|
+
Initial release
|
data/README.md
CHANGED
@@ -8,12 +8,12 @@ Add this line to your application's Gemfile:
|
|
8
8
|
|
9
9
|
# Gemfile
|
10
10
|
gem 'capistrano', '~> 3.0'
|
11
|
-
gem 'capistrano-rvm', '~> 0.0
|
11
|
+
gem 'capistrano-rvm', '~> 0.1.0'
|
12
12
|
|
13
13
|
And then execute:
|
14
14
|
|
15
|
-
$ bundle
|
16
|
-
$ cap install
|
15
|
+
$ bundle install
|
16
|
+
$ bundle exec cap install
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
@@ -37,7 +37,7 @@ Set those in the stage file dependant on your server configuration:
|
|
37
37
|
|
38
38
|
Valid options are:
|
39
39
|
* `:auto` (default): just tries to find the correct path.
|
40
|
-
|
40
|
+
`~/.rvm` wins over `/usr/local/rvm`
|
41
41
|
* `:system`: defines the RVM path to `/usr/local/rvm`
|
42
42
|
* `:user`: defines the RVM path to `~/.rvm`
|
43
43
|
|
@@ -49,7 +49,7 @@ the target host.
|
|
49
49
|
You can omit the ruby patch level from `:rvm_ruby_version` if you want, and
|
50
50
|
capistrano will choose the most recent patch level for that version of ruby:
|
51
51
|
|
52
|
-
set :rvm_ruby_version '2.0.0'
|
52
|
+
set :rvm_ruby_version, '2.0.0'
|
53
53
|
|
54
54
|
If you are using an rvm gemset, just specify it after your ruby_version:
|
55
55
|
|
@@ -68,14 +68,14 @@ to define a custom RVM path to tell capistrano where it is.
|
|
68
68
|
|
69
69
|
## Restrictions
|
70
70
|
|
71
|
-
Capistrano can't
|
71
|
+
Capistrano can't use rvm to install rubies or create gemsets, so on the
|
72
72
|
servers you are deploying to, you will have to manually use rvm to install the
|
73
73
|
proper ruby and create the gemset.
|
74
74
|
|
75
75
|
|
76
76
|
## How it works
|
77
77
|
|
78
|
-
This gem adds a new task `rvm:hook` before `deploy
|
78
|
+
This gem adds a new task `rvm:hook` before `deploy` task.
|
79
79
|
It sets the `rvm ... do ...` for capistrano when it wants to run
|
80
80
|
`rake`, `gem`, `bundle`, or `ruby`.
|
81
81
|
|
@@ -88,16 +88,6 @@ deployment.
|
|
88
88
|
|
89
89
|
$ cap production rvm:check
|
90
90
|
|
91
|
-
|
92
|
-
## Custom tasks which rely on RVM/Ruby
|
93
|
-
|
94
|
-
When building custom tasks which need a the corrent ruby and gemset, all you
|
95
|
-
have to do is run the `rvm:hook` task before your own task. This will handle
|
96
|
-
the execution of the ruby-related commands.
|
97
|
-
This is only necessary if your task is *not* *after* the `deploy:starting` task.
|
98
|
-
|
99
|
-
before :my_custom_task, 'rvm:hook'
|
100
|
-
|
101
91
|
## Contributing
|
102
92
|
|
103
93
|
1. Fork it
|
data/capistrano-rvm.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "capistrano-rvm"
|
7
|
-
gem.version = '0.0
|
7
|
+
gem.version = '0.1.0'
|
8
8
|
gem.authors = ["Kir Shatrov"]
|
9
9
|
gem.email = ["shatrov@me.com"]
|
10
10
|
gem.description = %q{RVM integration for Capistrano}
|
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.add_dependency 'capistrano'
|
18
|
+
gem.add_dependency 'capistrano', '~> 3.0'
|
19
|
+
gem.add_dependency 'sshkit', '~> 1.2.0'
|
19
20
|
|
20
21
|
end
|
@@ -1,33 +1,7 @@
|
|
1
1
|
RVM_SYSTEM_PATH = "/usr/local/rvm"
|
2
2
|
RVM_USER_PATH = "~/.rvm"
|
3
3
|
|
4
|
-
def bundler_loaded?
|
5
|
-
Gem::Specification::find_all_by_name('capistrano-bundler').any?
|
6
|
-
end
|
7
|
-
|
8
|
-
SSHKit.config.command_map = Hash.new do |hash, key|
|
9
|
-
if fetch(:rvm_map_bins).include?(key.to_s)
|
10
|
-
hash[key] = "#{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do #{key}"
|
11
|
-
elsif key.to_s == "rvm"
|
12
|
-
hash[key] = "#{fetch(:rvm_path)}/bin/rvm"
|
13
|
-
else
|
14
|
-
hash[key] = key
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
namespace :deploy do
|
19
|
-
after :starting, 'rvm:hook'
|
20
|
-
end
|
21
|
-
|
22
4
|
namespace :rvm do
|
23
|
-
desc "Runs the RVM hook - use it before any custom tasks if necessary"
|
24
|
-
task :hook do
|
25
|
-
unless fetch(:rvm_hooked)
|
26
|
-
invoke :'rvm:init'
|
27
|
-
set :rvm_hooked, true
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
5
|
desc "Prints the RVM and Ruby version on the target host"
|
32
6
|
task :check do
|
33
7
|
on roles(:all) do
|
@@ -36,14 +10,15 @@ namespace :rvm do
|
|
36
10
|
puts capture(:ruby, "--version")
|
37
11
|
end
|
38
12
|
end
|
39
|
-
before :check, 'rvm:hook'
|
40
13
|
|
41
|
-
task :
|
14
|
+
task :hook do
|
42
15
|
on roles(:all) do
|
43
16
|
rvm_path = fetch(:rvm_custom_path)
|
44
17
|
rvm_path ||= case fetch(:rvm_type)
|
45
18
|
when :auto
|
46
|
-
if test("[ -d #{
|
19
|
+
if test("[ -d #{RVM_USER_PATH} ]")
|
20
|
+
RVM_USER_PATH
|
21
|
+
elsif test("[ -d #{RVM_SYSTEM_PATH} ]")
|
47
22
|
RVM_SYSTEM_PATH
|
48
23
|
else
|
49
24
|
RVM_USER_PATH
|
@@ -53,19 +28,28 @@ namespace :rvm do
|
|
53
28
|
else # :user
|
54
29
|
RVM_USER_PATH
|
55
30
|
end
|
31
|
+
|
56
32
|
set :rvm_path, rvm_path
|
33
|
+
end
|
57
34
|
|
58
|
-
|
59
|
-
|
60
|
-
|
35
|
+
SSHKit.config.command_map[:rvm] = "#{fetch(:rvm_path)}/bin/rvm"
|
36
|
+
|
37
|
+
rvm_prefix = "#{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do"
|
38
|
+
fetch(:rvm_map_bins).each do |command|
|
39
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(rvm_prefix)
|
61
40
|
end
|
62
41
|
end
|
42
|
+
end
|
63
43
|
|
44
|
+
Capistrano::DSL.stages.each do |stage|
|
45
|
+
after stage, 'rvm:hook'
|
46
|
+
after stage, 'rvm:check'
|
64
47
|
end
|
65
48
|
|
66
49
|
namespace :load do
|
67
50
|
task :defaults do
|
68
|
-
set :rvm_map_bins,
|
51
|
+
set :rvm_map_bins, %w{gem rake ruby bundle}
|
69
52
|
set :rvm_type, :auto
|
53
|
+
set :rvm_ruby_version, "default"
|
70
54
|
end
|
71
55
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-rvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kir Shatrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sshkit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.2.0
|
27
41
|
description: RVM integration for Capistrano
|
28
42
|
email:
|
29
43
|
- shatrov@me.com
|
@@ -50,17 +64,17 @@ require_paths:
|
|
50
64
|
- lib
|
51
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- -
|
67
|
+
- - '>='
|
54
68
|
- !ruby/object:Gem::Version
|
55
69
|
version: '0'
|
56
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
71
|
requirements:
|
58
|
-
- -
|
72
|
+
- - '>='
|
59
73
|
- !ruby/object:Gem::Version
|
60
74
|
version: '0'
|
61
75
|
requirements: []
|
62
76
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.0.3
|
64
78
|
signing_key:
|
65
79
|
specification_version: 4
|
66
80
|
summary: RVM integration for Capistrano
|