Skip to content

Instantly share code, notes, and snippets.

@osdrv
Created November 6, 2012 15:49
Show Gist options
  • Save osdrv/4025546 to your computer and use it in GitHub Desktop.
Save osdrv/4025546 to your computer and use it in GitHub Desktop.
set :application, 'SBRFRoadshow'
set :scm, :git
set :repository, '[email protected]:/etc/git/customizer.git'
set :deploy_to, "/var/app/#{application}"
set :user, 'User'
set :use_sudo, false
set :normalize_asset_timestamps, false
server '192.168.0.10', :app, :web, :db, :primary => true
set :platform, "windows64"
namespace :deploy do
# windows doesn't support symlinks
# recover with hard copy
task :create_symlink, :except => { :no_release => true } do
stop
on_rollback do
if previous_release
run "unlink #{current_path}; ln -s #{previous_release} #{current_path}; true"
else
logger.important "no previous release to rollback to, rollback of symlink skipped"
end
end
run "unlink #{current_path}; ln -s #{latest_release} #{current_path}"
end
task :stop, :roles => :app do
run "ps -W | grep java | awk '{print $1}' | xargs kill -f"
end
task :start, :roles => :app do
run "/usr/local/bin/PsExec.exe -i 1 -s -d -w `cygpath -w #{current_path}/application.#{platform}` java -Djava.ext.dirs=lib -Djava.library.path=lib #{application} > /dev/null 2>&1; true"
end
task :restart, :roles => :app do
stop
start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment