Skip to content

Commit

Permalink
Add support for IAM (cherry picked from PR #5 due to merge conflicts,…
Browse files Browse the repository at this point in the history
… credits go to jespada).
  • Loading branch information
istepanov committed Apr 17, 2019
1 parent 4f95716 commit 53339fa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

set -e

: ${ACCESS_KEY:?"ACCESS_KEY env variable is required"}
: ${SECRET_KEY:?"SECRET_KEY env variable is required"}
: ${S3_PATH:?"S3_PATH env variable is required"}
export DATA_PATH=${DATA_PATH:-/data/}
CRON_SCHEDULE=${CRON_SCHEDULE:-0 1 * * *}

echo "access_key=$ACCESS_KEY" >> /root/.s3cfg
echo "secret_key=$SECRET_KEY" >> /root/.s3cfg
if [[ -n "$ACCESS_KEY" && -n "$SECRET_KEY" ]]; then
echo "access_key=$ACCESS_KEY" >> /root/.s3cfg
echo "secret_key=$SECRET_KEY" >> /root/.s3cfg
else
echo "No ACCESS_KEY and SECRET_KEY env variable found, assume use of IAM"
fi

if [[ "$1" == 'no-cron' ]]; then
exec /sync.sh
Expand Down

0 comments on commit 53339fa

Please sign in to comment.