Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support ruby installed by RVM on user-land (cooperate with rvm-capistrano) #22

Merged
merged 1 commit into from

2 participants

@tk0miya

I want to use ruby installed by RVM.
This change makes roundsman to support it.

@Arie Arie merged commit ffdfc12 into iain:master
@Arie Arie referenced this pull request from a commit
@Arie Arie Revert "Merge pull request #22 from tk0miya/cooperate-with-rvm-capist…
…rano"

This reverts commit ffdfc12, reversing
changes made to 9fcd6d6.
b954f11
@Arie
Collaborator

I've reverted the merge of this pull request. It causes the build to fail without rvm, would you be willing to fix that?

@tk0miya tk0miya deleted the tk0miya:cooperate-with-rvm-capistrano branch
@tk0miya

I fixed them and resend PR as #23. Try it again, please.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/roundsman/capistrano.rb
View
18 lib/roundsman/capistrano.rb
@@ -194,15 +194,27 @@ def ensure_supported_distro
desc "Installs chef"
task :install, :except => { :no_release => true } do
- sudo "gem uninstall -xaI chef || true"
- sudo "gem install chef -v #{fetch(:chef_version).inspect} --quiet --no-ri --no-rdoc"
- sudo "gem install ruby-shadow --quiet --no-ri --no-rdoc"
+ if rvm_type == :user
+ run "gem uninstall -xaI chef || true"
+ run "gem install chef -v #{fetch(:chef_version).inspect} --quiet --no-ri --no-rdoc"
+ run "gem install ruby-shadow --quiet --no-ri --no-rdoc"
+ else
+ sudo "gem uninstall -xaI chef || true"
+ sudo "gem install chef -v #{fetch(:chef_version).inspect} --quiet --no-ri --no-rdoc"
+ sudo "gem install ruby-shadow --quiet --no-ri --no-rdoc"
+ end
end
desc "Runs the existing chef configuration"
task :chef_solo, :except => { :no_release => true } do
logger.info "Now running #{fetch(:run_list).join(', ')}"
+ if rvm_type == :user
+ old_sudo = self[:sudo]
+ self[:sudo] = "rvmsudo_secure_path=1 #{File.join(rvm_bin_path, "rvmsudo")}"
+ end
+
sudo "chef-solo -c #{roundsman_working_dir("solo.rb")} -j #{roundsman_working_dir("solo.json")}#{' -l debug' if fetch(:debug_chef)}"
+ self[:sudo] = old_sudo
end
def ensure_cookbooks_exists
Something went wrong with that request. Please try again.