Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

I had another fix I wanted, but first thought I'd fix the build #23

Merged
merged 2 commits into from

3 participants

@austinfromboston

No description provided.

@austinfromboston

Something changed, maybe in rvm or chef, over the past 2 months, and now a soloist script that used to work is failing, claiming it can't find 'chef-solo'. It's being run via cap in an rvm-shell instance, which all looks right. Switching the sudo calls to rvmsudo fixes, but is pretty darn ugly. Got ideas on a beter fix?

@mkocher mkocher merged commit bb63504 into from
@mkocher
Owner

Huh, this commit is breaking the default_editor recipe which uses gem_package to install the plist gem. Frankly having chef install the gem has always been a little broken. I'll open an issue on pivotal_workstation to discuss.

@hiremaga

@austinfromboston FWIW, assuming RVM isn't reasonable unfortunately. A number of teams using PW now use Rbenv instead.

@cunnie & I are working on some reorganization of PW that may end up offering a convenient solution for the plist gem dependency, at least in the case of the default_editor recipe. More on this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. @austinfromboston

    Fix the build by specifying which version of hashie to pull

    austinfromboston authored aram price committed
  2. @austinfromboston

    use rvmsudo when available

    austinfromboston authored Omada committed
This page is out of date. Refresh to see the latest.
View
44 Gemfile.lock
@@ -1,10 +1,10 @@
PATH
remote: .
specs:
- soloist (1.0.0.pre)
+ soloist (1.0.0)
awesome_print
chef
- hashie
+ hashie (~> 1.2)
librarian
net-ssh
thor
@@ -14,24 +14,19 @@ GEM
specs:
archive-tar-minitar (0.5.2)
awesome_print (1.1.0)
- bunny (0.7.9)
- chef (10.16.2)
- bunny (>= 0.6.0, < 0.8.0)
+ chef (11.4.0)
erubis
highline (>= 1.6.9)
- json (>= 1.4.4, <= 1.6.1)
+ json (>= 1.4.4, <= 1.7.7)
mixlib-authentication (>= 1.3.0)
- mixlib-cli (>= 1.1.0)
+ mixlib-cli (~> 1.3.0)
mixlib-config (>= 1.1.2)
mixlib-log (>= 1.3.0)
mixlib-shellout
- moneta
- net-ssh (~> 2.2.2)
+ net-ssh (~> 2.6)
net-ssh-multi (~> 1.1.0)
ohai (>= 0.6.0)
rest-client (>= 1.0.4, < 1.7.0)
- treetop (~> 1.4.9)
- uuidtools
yajl-ruby (~> 1.1)
coderay (1.0.8)
diff-lcs (1.1.3)
@@ -51,11 +46,11 @@ GEM
guard-shell (0.5.1)
guard (>= 1.1.0)
hashie (1.2.0)
- highline (1.6.15)
+ highline (1.6.16)
ipaddress (0.8.0)
- json (1.6.1)
- json (1.6.1-java)
- librarian (0.0.25)
+ json (1.7.7)
+ json (1.7.7-java)
+ librarian (0.0.26)
archive-tar-minitar (>= 0.5.2)
chef (>= 0.10)
highline
@@ -63,28 +58,27 @@ GEM
listen (0.6.0)
lumberjack (1.0.2)
method_source (0.8.1)
- mime-types (1.19)
+ mime-types (1.21)
mixlib-authentication (1.3.0)
mixlib-log
- mixlib-cli (1.2.2)
+ mixlib-cli (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.4.1)
mixlib-shellout (1.1.0)
- moneta (0.6.0)
- net-ssh (2.2.2)
- net-ssh-gateway (1.1.0)
- net-ssh (>= 1.99.1)
+ net-ssh (2.6.6)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
net-ssh-multi (1.1)
net-ssh (>= 2.1.4)
net-ssh-gateway (>= 0.99.0)
- ohai (6.14.0)
+ ohai (6.16.0)
ipaddress
mixlib-cli
mixlib-config
mixlib-log
+ mixlib-shellout
systemu
yajl-ruby
- polyglot (0.3.3)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
@@ -110,10 +104,6 @@ GEM
systemu (2.5.2)
terminal-notifier-guard (1.5.3)
thor (0.16.0)
- treetop (1.4.12)
- polyglot
- polyglot (>= 0.3.1)
- uuidtools (2.1.3)
yajl-ruby (1.1.0)
PLATFORMS
View
7 lib/soloist/config.rb
@@ -95,13 +95,18 @@ def debug?
private
def conditional_sudo(command)
- root? ? command : "sudo -E #{command}"
+ sudo_command = rvm? ? "rvmsudo_secure_path=1 rvmsudo" : "sudo"
+ root? ? command : "#{sudo_command} -E #{command}"
end
def root?
Process.uid == 0
end
+ def rvm?
+ `which rvm`.length > 0
+ end
+
def royal_crown_cookbooks_directory
File.expand_path("cookbooks", royal_crown_path)
end
View
2  soloist.gemspec
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency "chef"
s.add_dependency "librarian"
s.add_dependency "thor"
- s.add_dependency "hashie"
+ s.add_dependency "hashie", "~> 1.2"
s.add_dependency "net-ssh"
s.add_dependency "awesome_print"
View
25 spec/lib/soloist/cli_spec.rb
@@ -92,11 +92,28 @@
end
context "when the user is not root" do
- it "creates the cache path using sudo" do
- cli.soloist_config.should_receive(:exec) do |command|
- command.should =~ /^sudo -E/
+ context "when rvm is not present" do
+ before do
+ cli.soloist_config.stub(:rvm?).and_return(false)
+ end
+ it "creates the cache path using sudo" do
+ cli.soloist_config.should_receive(:exec) do |command|
+ command.should =~ /^sudo -E/
+ end
+ cli.chef
+ end
+ end
+
+ context "when rvm is present" do
+ before do
+ cli.soloist_config.stub(:rvm?).and_return(true)
+ end
+ it "creates the cache path using rvmsudo" do
+ cli.soloist_config.should_receive(:exec) do |command|
+ command.should =~ /rvmsudo -E/
+ end
+ cli.chef
end
- cli.chef
end
end
Something went wrong with that request. Please try again.