Skip to content

Commit 87eb2c4

Browse files
committed
TESt
1 parent fd2dc2f commit 87eb2c4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

bin/aws-code-deploy.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,20 +373,23 @@ S3_CP="aws s3 cp"
373373
S3_BUCKET="$AWS_CODE_DEPLOY_S3_BUCKET"
374374
S3_FULL_BUCKET="$S3_BUCKET"
375375

376+
# Resolve dynamic
377+
AWS_CODE_DEPLOY_S3_FILENAME=$AWS_CODE_DEPLOY_S3_FILENAME
378+
376379
# Strip off any "/" from front and end, but allow inside
377380
S3_KEY_PREFIX=$(echo "${AWS_CODE_DEPLOY_S3_KEY_PREFIX}" | sed 's/^\/\?\(.*[^\/]\)\/\?$/\1/')
378381

379382
if [ ! -z "$S3_KEY_PREFIX" ]; then
380-
S3_FULL_BUCKET="$S3_FULL_BUCKET/$S3_KEY_PREFIX"
383+
S3_FULL_BUCKET="${S3_FULL_BUCKET}/${S3_KEY_PREFIX}"
381384
fi
382385

383386
if [ "$AWS_CODE_DEPLOY_S3_SSE" == "true" ]; then
384-
S3_CP="$S3_CP --sse AES256"
387+
S3_CP="${S3_CP} --sse AES256"
385388
fi
386389

387-
runCommand "$S3_CP \"$APP_LOCAL_TEMP_FILE\" \"s3://$S3_FULL_BUCKET/$AWS_CODE_DEPLOY_S3_FILENAME\"" \
388-
"Unable to copy bundle \"$APP_LOCAL_TEMP_FILE\" to S3" \
389-
"Successfully copied bundle \"$APP_LOCAL_TEMP_FILE\" to s3://$S3_FULL_BUCKET/$AWS_CODE_DEPLOY_S3_FILENAME"
390+
runCommand "$S3_CP \"$APP_LOCAL_TEMP_FILE\" \"s3://${S3_FULL_BUCKET}/${AWS_CODE_DEPLOY_S3_FILENAME}\"" \
391+
"Unable to copy bundle \"${APP_LOCAL_TEMP_FILE}\" to S3" \
392+
"Successfully copied bundle \"${APP_LOCAL_TEMP_FILE}\" to s3://${S3_FULL_BUCKET}/${AWS_CODE_DEPLOY_S3_FILENAME}"
390393

391394

392395

0 commit comments

Comments
 (0)