Skip to content

Commit

Permalink
update: renaming environment variables to make AWS related calls visible
Browse files Browse the repository at this point in the history
  • Loading branch information
shinitiandrei committed May 6, 2022
1 parent d65cbde commit b6c3135
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ set -euo pipefail

STORAGE_SERVICE_ALIAS=${STORAGE_SERVICE_ALIAS:="s3"}
STORAGE_SERVICE_URL=${STORAGE_SERVICE_URL:="https://s3.amazonaws.com"}
SESSION_TOKEN=${SESSION_TOKEN:=""}
AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN:=""}
MIRROR_SOURCE=${MIRROR_SOURCE:="."}
REGION=${REGION:=""}
AWS_REGION=${AWS_REGION:=""}

# Set mc configuration
if [ -z "$SESSION_TOKEN" ]; then
if [ -z "$AWS_SESSION_TOKEN" ]; then
mc alias set "$STORAGE_SERVICE_ALIAS" "$STORAGE_SERVICE_URL" "$ACCESS_KEY_ID" "$SECRET_ACCESS_KEY"
else
export MC_HOST_${STORAGE_SERVICE_ALIAS}=https://${ACCESS_KEY_ID}:${SECRET_ACCESS_KEY}:${SESSION_TOKEN}@s3.${REGION}.amazonaws.com
export MC_HOST_${STORAGE_SERVICE_ALIAS}=https://${ACCESS_KEY_ID}:${SECRET_ACCESS_KEY}:${AWS_SESSION_TOKEN}@s3.${AWS_REGION}.amazonaws.com
fi

# Execute mc mirror
Expand Down

0 comments on commit b6c3135

Please sign in to comment.