Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 7, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions lib/roundsman/capistrano.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -194,15 +194,27 @@ def ensure_supported_distro


desc "Installs chef" desc "Installs chef"
task :install, :except => { :no_release => true } do task :install, :except => { :no_release => true } do
sudo "gem uninstall -xaI chef || true" if rvm_type == :user
sudo "gem install chef -v #{fetch(:chef_version).inspect} --quiet --no-ri --no-rdoc" run "gem uninstall -xaI chef || true"
sudo "gem install ruby-shadow --quiet --no-ri --no-rdoc" 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 end


desc "Runs the existing chef configuration" desc "Runs the existing chef configuration"
task :chef_solo, :except => { :no_release => true } do task :chef_solo, :except => { :no_release => true } do
logger.info "Now running #{fetch(:run_list).join(', ')}" 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)}" 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 end


def ensure_cookbooks_exists def ensure_cookbooks_exists
Expand Down