From 2247103e448a1e0e8a684dec8e84c2e34920fa0a Mon Sep 17 00:00:00 2001 From: Joe Kutner Date: Mon, 9 Jan 2012 17:49:01 -0600 Subject: [PATCH] created do_deploy function to match rake tasks --- lib/torquebox/remote_deploy_utils.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/torquebox/remote_deploy_utils.rb b/lib/torquebox/remote_deploy_utils.rb index 8226e57..e01593a 100644 --- a/lib/torquebox/remote_deploy_utils.rb +++ b/lib/torquebox/remote_deploy_utils.rb @@ -17,20 +17,20 @@ def stage(archive_file) def deploy(archive_file) with_config(archive_file) do |config, app_name| scp_upload(config, archive_file, "#{config.torquebox_home}/jboss/standalone/deployments/") - ssh_exec(config, "touch #{config.torquebox_home}/jboss/standalone/deployments/#{app_name}.dodeploy") + do_deploy(config, app_name) end end def deploy_from_stage(archive_file) with_config(archive_file) do |config, app_name| ssh_exec(config, "cp #{config.torquebox_home}/stage/#{app_name}.knob #{config.torquebox_home}/jboss/standalone/deployments") - ssh_exec(config, "touch #{config.torquebox_home}/jboss/standalone/deployments/#{app_name}.dodeploy") + do_deploy(config, app_name) end end def undeploy(archive_file) with_config(archive_file) do |config, app_name| - ssh_exec(config, "rm #{config.torquebox_home}/jboss/standalone/deployments/#{app_name}.*") + ssh_exec(config, "rm -f #{config.torquebox_home}/jboss/standalone/deployments/#{app_name}.knob*") end end @@ -48,6 +48,10 @@ def prefix(config) config.sudo ? "sudo" : p end + def do_deploy(config, app_name) + ssh_exec(config, "touch #{config.torquebox_home}/jboss/standalone/deployments/#{app_name}.knob.dodeploy") + end + def app_name(archive_file) File.basename(archive_file, ".knob") end