From b526c072a1046ec23cc58378bd8335c14056c1df Mon Sep 17 00:00:00 2001 From: Mike Benowitz Date: Mon, 8 Jul 2019 14:29:57 -0400 Subject: [PATCH] Add EBS configuration options This adds `.ebextension` options to the repository that can control how the beanstalk environment is configured. The two files perform different tasks: - `sfr-bardo-copyright-development.config` is an empty file for environment variables (empty because at present ENV variables contain secrets that cannot be committed to source control) - `cron-linux.config` contains configuration details for a nightly cron task that checks for updates from the source git repositories --- .ebextensions/cron-linux.config | 18 ++++++++++++++++++ .../sfr-bardo-copyright-development.config | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 .ebextensions/cron-linux.config create mode 100644 .ebextensions/sfr-bardo-copyright-development.config diff --git a/.ebextensions/cron-linux.config b/.ebextensions/cron-linux.config new file mode 100644 index 0000000..d9e6dc1 --- /dev/null +++ b/.ebextensions/cron-linux.config @@ -0,0 +1,18 @@ +files: + "/etc/cron.d/mycron": + mode: "000644" + owner: root + group: root + content: | + 10 1 * * * root /usr/local/bin/updateNightly.sh + + "/usr/local/bin/updateNightly.sh": + mode: "000755" + owner: root + group: root + content: | + #!/bin/bash + + while read -r line; do eval "$line"; done < /opt/python/current/env + + python3 /opt/python/current/app/main.py --time 86400 \ No newline at end of file diff --git a/.ebextensions/sfr-bardo-copyright-development.config b/.ebextensions/sfr-bardo-copyright-development.config new file mode 100644 index 0000000..6697ef2 --- /dev/null +++ b/.ebextensions/sfr-bardo-copyright-development.config @@ -0,0 +1,2 @@ +option_settings: + aws:elasticbeanstalk:application:environment: \ No newline at end of file