Skip to content

Instantly share code, notes, and snippets.

View Mozart2234's full-sized avatar
🏠
Working from home

Alexei Mamani Mozart2234

🏠
Working from home
View GitHub Profile
@StefanieD
StefanieD / 01cronjobs.config
Last active June 12, 2021 03:12
Run AWS Elastic Beanstalk container commands based on environment
container_commands:
# check for environemt within command to use leader flag
01_portfolio_update_cron_job:
command: 'if [ "$SYMFONY_ENV" != "staging" ]; then cat .ebextensions/cronjobs/portfolio_cron_job.txt > /etc/cron.d/portfolio_cron_job && chmod 644 /etc/cron.d/portfolio_cron_job; else echo "dont include portfolio cron";fi'
leader_only: true
# command should run on all instances, we can use the test command for environment check
02_synch_cron_job:
command: cat .ebextensions/cronjobs/synch_cron.txt > /etc/cron.d/synch_cron && chmod 644 /etc/cron.d/synch_cron
test: '[ "$SYMFONY_ENV" == "develop" ]'