Skip to content

Instantly share code, notes, and snippets.

@jimmdd
Last active December 5, 2019 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmdd/960e9a57712b9f7b6c998652ad1d3f15 to your computer and use it in GitHub Desktop.
Save jimmdd/960e9a57712b9f7b6c998652ad1d3f15 to your computer and use it in GitHub Desktop.
build spec for aws codebuild
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install serverless -g
build:
commands:
- npm install
- |
if expr "${CLOUDFRONTID}" : "DEFAULT" >/dev/null; then
serverless;
aws s3 sync ./.serverless s3://${YOUR S3 BUCKET}/.serverless;
else
aws s3 sync s3://${YOUR S3 BUCKET}/.serverless ./.serverless;
serverless;
aws cloudfront create-invalidation --distribution-id ${CLOUDFRONTID} --paths '/*';
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment