Skip to content

Commit

Permalink
Merge pull request #8 from kwilczynski/bugfix/fix-environment-variables
Browse files Browse the repository at this point in the history
Fix command-line switches assemble using environment variables.
  • Loading branch information
tdi authored Dec 4, 2019
2 parents 7148620 + 3df125a commit fe8312e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions assume-role-arn.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#!/bin/sh

set -e
if [ "x$DEBUG" = 'xtrue' ]; then
if [ "x${DEBUG}" = 'xtrue' ]; then
set -x && VERBOSE='true'
fi

export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'

ASSUME_ROLE_ARN='assume-role-arn'

if [ "x$AWS_PROFILE" = 'xtrue' ]; then
if [ "x${AWS_PROFILE}" != 'x' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -p $AWS_PROFILE"
fi

if [ "x$ROLE_ARN" = 'xtrue' ]; then
if [ "x${ROLE_ARN}" != 'x' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -r $ROLE_ARN"
fi

if [ "x$ROLE_SESSION_NAME" != 'x' ]; then
if [ "x${ROLE_SESSION_NAME}" != 'x' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -n $ROLE_SESSION_NAME"
fi

if [ "x$EXTERNAL_ID" != 'x' ]; then
if [ "x${EXTERNAL_ID}" != 'x' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -e $EXTERNAL_ID"
fi

if [ "x$SKIP_CACHE" = 'xtrue' ]; then
if [ "x${SKIP_CACHE}" = 'xtrue' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -skipCache"
fi

if [ "x$VERBOSE" = 'xtrue' ]; then
if [ "x${VERBOSE}" = 'xtrue' ]; then
ASSUME_ROLE_ARN="$ASSUME_ROLE_ARN -v"
fi

Expand Down
4 changes: 2 additions & 2 deletions docker-entrypoint.d/001-verify-aws-credentials.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

set -e
if [ "x$DEBUG" = 'xtrue' ]; then
if [ "x${DEBUG}" = 'xtrue' ]; then
set -x
fi

if [ "x$CHECK_ENVIRONMENT" = 'xfalse' ]; then
if [ "x${CHECK_ENVIRONMENT}" = 'xfalse' ]; then
echo 'Environment variables check has been disabled.'
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

set -e
if [ "x$DEBUG" = 'xtrue' ]; then
if [ "x${DEBUG}" = 'xtrue' ]; then
set -x
fi

Expand Down

0 comments on commit fe8312e

Please sign in to comment.