Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixes to jruby_home when torquebox_home is changed from default #13

Merged
merged 3 commits into from

2 participants

@agmcleod

Something i noticed when using /opt/torquebox/current as the torquebox home directory, as that the jruby_home path does not update with it. So i made that fix, and wrote specs to account for those cases.

@jkutner jkutner merged commit 3fe92cb into jkutner:master
@jkutner
Owner

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 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
Something went wrong with that request. Please try again.