-
-
Save Nosfheratu/1365a6aa92bdee396e7ddfcd9ef5dc92 to your computer and use it in GitHub Desktop.
Schedule script for using Whenever toghether with rbenv
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
# Schedule script for using Whenever toghether with rbenv | |
# | |
# Whenever: https://github.com/javan/whenever | |
# rbenv: https://github.com/sstephenson/rbenv | |
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"' | |
# doesn't need modifications | |
# job_type :command, ":task :output" | |
job_type :rake, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec rake :task --silent :output } | |
job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" script/rails runner -e :environment ':task' :output } | |
job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec script/:task :output } | |
# tasks | |
every 1.day, :at => Time.now + 1.minute do | |
rake "my:task" | |
runner "puts 'hello from runner'" | |
script 'hello' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment