Skip to content

Instantly share code, notes, and snippets.

@jlstr
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlstr/8777950 to your computer and use it in GitHub Desktop.
Save jlstr/8777950 to your computer and use it in GitHub Desktop.
desc "starts sidekiq"
task :start_sidekiq do
run "cd /home/deploy/work/tiptotem/current/ && bundle exec sidekiq -d -L /home/deploy/work/tiptotem/current/tmp/sidekiq.log -e production"
end
after 'deploy', 'servers:start_sidekiq'
desc "stops sidekiq"
task :stop_sidekiq do
message = "Sidekiq not working"
run "if [ -z $(ps -ef | awk '/sidekiq/{print $2}') ]; then echo #{message}; else kill -9 $(ps -ef | awk '/sidekiq/{print $2}'); fi"
end
before 'deploy', 'servers:stop_sidekiq'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment