Skip to content

Commit

Permalink
Use -n rather than -z for the endpoint var
Browse files Browse the repository at this point in the history
  • Loading branch information
borkweb committed Feb 17, 2021
1 parent 753a431 commit 1ea8f6f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion commands/exists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
echo "Checking for file existence at s3://${S3_BUCKET}/${FILE} at the ${S3_ENDPOINT}"

# Verify file existence.
sh -c "aws s3api head-object --bucket ${S3_BUCKET} --key ${FILE} $S3_PROFILE $ENDPOINT_APPEND $*"
sh -c "aws s3api head-object --bucket ${S3_BUCKET} --key ${FILE} ${S3_PROFILE} ${ENDPOINT_APPEND} $*"

# XXX: we are just checking the error code, but should check the result for a 404, and raise error in other cases
if [ $? == 0 ]
Expand Down
2 changes: 1 addition & 1 deletion commands/ls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
echo $ENDPOINT_APPEND

# Verify file existence.
output=$(sh -c "aws s3 ls s3://${S3_BUCKET}/${FILE} $S3_PROFILE $ENDPOINT_APPEND $*")
output=$(sh -c "aws s3 ls s3://${S3_BUCKET}/${FILE} ${S3_PROFILE} ${ENDPOINT_APPEND} $*")

echo $output

Expand Down
2 changes: 1 addition & 1 deletion commands/rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ -z "$FILE" ]; then
fi

# Verify file existence.
output=$(sh -c "aws s3 rm s3://${S3_BUCKET}/${FILE} $S3_PROFILE $ENDPOINT_APPEND $*")
output=$(sh -c "aws s3 rm s3://${S3_BUCKET}/${FILE} ${S3_PROFILE} ${ENDPOINT_APPEND} $*")

echo $output

Expand Down
2 changes: 1 addition & 1 deletion commands/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e

# Sync path.
sh -c "aws s3 sync ${SOURCE_DIR:-.} s3://${S3_BUCKET}/${DEST_DIR} $S3_PROFILE --no-progress $ENDPOINT_APPEND $*"
sh -c "aws s3 sync ${SOURCE_DIR:-.} s3://${S3_BUCKET}/${DEST_DIR} ${S3_PROFILE} --no-progress ${ENDPOINT_APPEND} $*"
8 changes: 4 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ fi

# Default to us-east-1 if AWS_REGION not set.
if [ -z "$S3_REGION" ]; then
export S3_REGION="us-east-1"
S3_REGION="us-east-1"
fi

# Override default AWS endpoint if user sets S3_ENDPOINT
if [ -z "$S3_ENDPOINT" ]; then
export ENDPOINT_APPEND="--endpoint-url ${S3_ENDPOINT}"
if [ -n "$S3_ENDPOINT" ]; then
ENDPOINT_APPEND="--endpoint-url ${S3_ENDPOINT}"
fi

export S3_PROFILE="--profile action-s3-utility"
S3_PROFILE="--profile action-s3-utility"

# Create a dedicated profile for this action
aws configure --profile action-s3-utility <<-EOF > /dev/null 2>&1
Expand Down

0 comments on commit 1ea8f6f

Please sign in to comment.