Add CDN cache invalidation to deploy scripts.

This commit is contained in:
2019-09-25 10:48:46 -05:00
parent 5c81d756df
commit cfd5463b4d
3 changed files with 32 additions and 3 deletions

View File

@ -11,7 +11,7 @@ dist/personal-measure-api.tar.gz:
dist/personal-measure-web.tar.gz:
-mkdir dist
(cd web && npm run build)
TARGET_ENV=$(TARGET_ENV) make -C web build
tar czf dist/personal-measure-web-${VERSION}.tar.gz -C web/dist .
cp dist/personal-measure-web-${VERSION}.tar.gz dist/personal-measure-web.tar.gz
@ -27,6 +27,7 @@ deploy-web: dist/personal-measure-web.tar.gz
mkdir -p temp-deploy/personal-measure-web-${VERSION}
tar xzf dist/personal-measure-web-${VERSION}.tar.gz -C temp-deploy/personal-measure-web-${VERSION}
aws s3 sync temp-deploy/personal-measure-web-${VERSION} s3://pm.jdb-labs.com/$(TARGET_ENV)/webroot
TARGET_ENV=${TARGET_ENV} operations/invalidate-cdn-cache.sh
rm -r temp-deploy
deploy: deploy-api deploy-web