Skip to content

Commit e8c3b81

Browse files
committed
Merge pull request #41 from cheald/master
Allow for overriding of RVM roles
2 parents 6aa7cb9 + e5b9771 commit e8c3b81

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ or
6464

6565
set :rvm_ruby_version, '2.0.0@mygemset'
6666

67-
6867
### Custom RVM path: `:rvm_custom_path`
6968

7069
If you have a custom RVM setup with a different path then expected, you have
7170
to define a custom RVM path to tell capistrano where it is.
7271

72+
### Custom Roles: `:rvm_roles`
73+
74+
If you want to restrict RVM usage to a subset of roles, you may set `:rvm_roles`:
75+
76+
set :rvm_roles, [:app, :web]
7377

7478
## Restrictions
7579

lib/capistrano/tasks/rvm.rake

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ RVM_USER_PATH = "~/.rvm"
44
namespace :rvm do
55
desc "Prints the RVM and Ruby version on the target host"
66
task :check do
7-
on roles(:all) do
7+
on roles(fetch(:rvm_roles, :all)) do
88
puts capture(:rvm, "version")
99
puts capture(:rvm, "current")
1010
puts capture(:ruby, "--version")
1111
end
1212
end
1313

1414
task :hook do
15-
on roles(:all) do
15+
on roles(fetch(:rvm_roles, :all)) do
1616
rvm_path = fetch(:rvm_custom_path)
1717
rvm_path ||= case fetch(:rvm_type)
1818
when :auto

0 commit comments

Comments
 (0)