Retrospring/lib/capistrano/tasks/restart.rake

39 lines
893 B
Ruby
Raw Normal View History

2017-03-29 13:00:47 -07:00
namespace :deploy do
task :start do
on roles(:all) do
puts "------- skip start"
next
2017-03-29 13:00:47 -07:00
rvm_prefix = "#{fetch(:rvm1_auto_script_path)}/rvm-auto.sh #{fetch(:rvm1_ruby_version)}"
execute :tmux, 'new-session',
'-d',
'-s', 'retrospring',
'-n', 'retrospring',
'-c', '/usr/home/justask/apps/retrospring/current',
"'#{rvm_prefix} bundle exec foreman start'"
end
end
task :stop do
on roles(:all) do
puts "------- skip stop"
next
2017-03-29 13:40:40 -07:00
execute :sh, '-c', '\'tmux list-panes -t retrospring -F "#{pane_pid}" | xargs kill\''
2017-03-29 13:00:47 -07:00
end
end
desc 'Restart the server'
task :restart do
on roles(:all) do
puts "------- skip restart"
next
2017-03-29 13:00:47 -07:00
info 'Restarting application server'
invoke('deploy:stop')
2017-03-31 15:09:15 -07:00
info 'Waiting 5 seconds'
sleep 5
2017-03-29 13:00:47 -07:00
invoke('deploy:start')
end
end
end