Skip to content

Commit 5ed22f6

Browse files
committed
Another deploy update
1 parent a9b8b6c commit 5ed22f6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

deploy.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,32 @@ configure_aws_cli() {
2222
deploy_s3bucket() {
2323
if [ "$NOCACHE" = "true" ]; then
2424
S3_CACHE_OPTIONS="--cache-control private,no-store,no-cache,must-revalidate,max-age=0"
25+
echo "*** Deploying with Cloudfront Cache disabled ***"
2526
else
2627
S3_CACHE_OPTIONS="--cache-control max-age=0,s-maxage=86400"
2728
fi
2829

29-
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --exclude "*.txt" --exclude "*.js" --exclude "*.css" ${S3_CACHE_OPTIONS}
30-
result=$(aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --exclude "*.txt" --exclude "*.js" --exclude "*.css" ${S3_CACHE_OPTIONS})
30+
S3_OPTIONS="--exclude '*.txt' --exclude '*.js' --exclude '*.css'"
31+
echo aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}
32+
eval "aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"
33+
result=`eval "aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"`
3134
if [ $? -eq 0 ]; then
3235
echo "All html, font, image, map and media files are Deployed without gzip encoding!"
3336
else
3437
echo "Deployment Failed - $result"
3538
exit 1
3639
fi
3740

38-
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip ${S3_CACHE_OPTIONS}
39-
result=$(aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip ${S3_CACHE_OPTIONS})
41+
S3_OPTIONS="--exclude '*' --include '*.txt' --include '*.js' --include '*.css' --content-encoding gzip"
42+
echo aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}
43+
eval "aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"
44+
result=`eval "aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"`
4045
if [ $? -eq 0 ]; then
4146
echo "All txt, css, and js files are Deployed! with gzip"
4247
else
4348
echo "Deployment Failed - $result"
4449
exit 1
45-
fi
46-
50+
fi
4751
}
4852

4953
echo -e "application/font-woff\t\t\t\twoff2" >> /etc/mime.types

0 commit comments

Comments
 (0)