Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #13 from agmcleod/master

Fixes to jruby_home when torquebox_home is changed from default
  • Loading branch information...
commit 3fe92cbeb8d1f923a997d51e79d9a448d2292636 2 parents 9936b42 + 81caae9
@jkutner authored
Showing with 37 additions and 2 deletions.
  1. +5 −2 lib/torquebox/remote_deploy_utils.rb
  2. +32 −0 spec/remote_deploy_spec.rb
View
7 lib/torquebox/remote_deploy_utils.rb
@@ -65,10 +65,10 @@ def exec_ruby(archive_file, cmd)
with_config(archive_file) do |config, app_name|
unless config.local
ssh_exec(config, "cd #{config.torquebox_home}/stage/#{app_name}",
- "export PATH=#{config.jruby_home}/bin:$PATH",
+ # "export PATH=#{config.jruby_home}/bin:$PATH",
"export RAILS_ENV=#{config.rack_env}",
"export RACK_ENV=#{config.rack_env}",
- "jruby -S #{cmd}")
+ "#{config.jruby_home}/bin/jruby -S #{cmd}")
else
# not sure what to do here yet
end
@@ -204,6 +204,9 @@ def key(k)
end
def torquebox_home(tbh)
+ if @config.jruby_home == "#{@config.torquebox_home}/jruby"
+ jruby_home("#{tbh}/jruby")
+ end
@config.torquebox_home = tbh
end
View
32 spec/remote_deploy_spec.rb
@@ -50,6 +50,38 @@
end
end
+ context "change to torquebox home" do
+ subject do
+
+ end
+
+ it "jruby_home should be updated to match torquebox prefix" do
+ object = TorqueBox::RemoteDeploy.configure do
+ torquebox_home "/opt/torquebox/current"
+ hostname "1.2.3.4"
+ port "2222"
+ user "torquebox"
+ key "~/.ssh/id_rsa.pub"
+ sudo true
+ end
+ object.config.jruby_home.should == "/opt/torquebox/current/jruby"
+ end
+
+ it "if jruby_home is changed, then torquebox_home, jruby should not be effected" do
+ object = TorqueBox::RemoteDeploy.configure do
+ torquebox_home "/opt/torquebox/current"
+ jruby_home "~/jruby"
+ hostname "1.2.3.4"
+ port "2222"
+ user "torquebox"
+ key "~/.ssh/id_rsa.pub"
+ sudo true
+ end
+
+ object.config.jruby_home.should == "~/jruby"
+ end
+ end
+
context "overrides" do
subject do
TorqueBox::RemoteDeploy.configure do
Please sign in to comment.
Something went wrong with that request. Please try again.