Skip to content

Instantly share code, notes, and snippets.

@ahorner
Last active December 15, 2015 15:38
Show Gist options
  • Save ahorner/5282730 to your computer and use it in GitHub Desktop.
Save ahorner/5282730 to your computer and use it in GitHub Desktop.
RAKE = '/usr/bin/env ' +
'`' +
'/usr/bin/env bundle check >/dev/null 2>&1; ' +
'case $? in ' +
# Exit code 0: bundle is defined and installed
# Exit code 1: bundle is defined but not installed
'0|1 ) ' +
'echo bundle exec ' +
';; ' +
'esac' +
'` ' +
'rake'
namespace :daemons do
task :start, roles: :app do
run "cd #{current_path} && #{RAKE} daemons:start RAILS_ENV=#{rails_env}"
end
task :stop, roles: :app do
run "cd #{current_path} && #{RAKE} daemons:stop RAILS_ENV=#{rails_env}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment