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

Add environment command-line arg to whenever crontab write; update re… #64

Merged

Conversation

vcavallo
Copy link
Contributor

@vcavallo vcavallo commented Feb 2, 2017

Allows environments other than production to be written to the whenever-generated crontab.

@arBmind
Copy link
Member

arBmind commented Feb 2, 2017

I was stupid. See below.

Copy link
Member

@arBmind arBmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out this issue. Sorry that it took a while to get it.

Can you please check my comments. I hope we can find an easier solution that way.

@@ -1,5 +1,5 @@
- name: Update cronjobs for app
command: "{{ profile }}'bundle exec whenever --update-crontab {{ app_name }}'"
command: "{{ profile }}'bundle exec whenever --set environment={{ rails_env}} --update-crontab {{ app_name }}'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--set environment=$RAILS_ENV should work here.

We never use the rails_env argument in the Rails roles. So it would be undocumented.


```
every 1.day, at: "4:00am" do
rake "some_task:thing", environment: @environment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess that rake tasks pick up the @environment without this parameter.

@arBmind arBmind merged commit c98f047 into dresden-weekly:develop Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants