Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

including RAILS_ENV in task commands #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/mina/whenever/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
task clear: :environment do
comment "Clear contrab for #{fetch(:whenever_name)}"
in_path fetch(:current_path) do
command "#{fetch(:bundle_bin)} exec whenever --clear-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
command "RAILS_ENV=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --clear-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
end
end

desc 'Update crontab'
task update: :environment do
comment "Update crontab for #{fetch(:whenever_name)}"
in_path fetch(:current_path) do
command "#{fetch(:bundle_bin)} exec whenever --update-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
command "RAILS_ENV=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --update-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
end
end

desc 'Write crontab'
task write: :environment do
comment "Write crontab for #{fetch(:whenever_name)}"
in_path fetch(:current_path) do
command "#{fetch(:bundle_bin)} exec whenever --write-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
command "RAILS_ENV=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --write-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
end
end
end
2 changes: 1 addition & 1 deletion lib/mina/whenever/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Mina
module Whenever
VERSION = '1.0.0'
VERSION = '1.1.0'
end
end