Last active
December 15, 2015 15:38
-
-
Save ahorner/5282730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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