1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

deployment tweaks

This commit is contained in:
Matthias Kretschmann 2018-05-25 16:43:04 +02:00
parent 20491c075f
commit b1d00472eb
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 14 additions and 11 deletions

View File

@ -26,7 +26,7 @@
"gatsby-link": "^1.6.44",
"gatsby-plugin-favicon": "^2.1.1",
"gatsby-plugin-google-analytics": "^1.0.31",
"gatsby-plugin-matomo": "^0.3.1",
"gatsby-plugin-matomo": "^0.3.2",
"gatsby-plugin-offline": "^1.0.16",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-plugin-react-next": "^1.0.11",
@ -63,5 +63,7 @@
"stylelint": "^9.2.1",
"stylelint-config-standard": "^18.2.0"
},
"browserslist": ["defaults"]
"browserslist": [
"defaults"
]
}

View File

@ -4,29 +4,30 @@
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_DEFAULT_REGION
# AWS_S3_BUCKET
AWS_S3_BUCKET="matthiaskretschmann.com"
AWS_S3_BUCKET_BETA="beta.matthiaskretschmann.com"
#
set -e;
function s3sync {
aws s3 sync ./public s3://"$1" --exclude "*.html" --exclude "*.js" --cache-control max-age=31536000,public --delete --acl public-read
aws s3 sync ./public s3://"$1" --exclude "*" --include "*.html" --include "*.js" --cache-control max-age=0,no-cache,no-store,must-revalidate --delete --acl public-read
}
##
## check for pull request against master
##
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
aws s3 sync \
--delete \
--acl public-read \
./public s3://"$AWS_S3_BUCKET_BETA"
s3sync $AWS_S3_BUCKET_BETA
##
## check for master push which is no pull request
##
elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$TRAVIS" != true ]; then
aws s3 sync \
--delete \
--acl public-read \
./public s3://"$AWS_S3_BUCKET"
s3sync $AWS_S3_BUCKET
echo "---------------------------------------------"
echo " ✓ done deployment "