personal-measure/Makefile
2019-05-18 17:45:43 -05:00

30 lines
1.2 KiB
Makefile

VERSION:=$(shell git describe --always)
build: dist/personal-measure-api.tar.gz dist/personal-measure-web.tar.gz
dist/personal-measure-api.tar.gz:
-mkdir dist
make -C api personal_measure_api
tar czf dist/personal-measure-api-${VERSION}.tar.gz -C api personal_measure_api
cp dist/personal-measure-api-${VERSION}.tar.gz dist/personal-measure-api.tar.gz
dist/personal-measure-web.tar.gz:
-mkdir dist
(cd web && npm run 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
deploy-api: dist/personal-measure-api.tar.gz
mkdir -p temp-deploy/personal-measure-api-${VERSION}
tar xzf dist/personal-measure-api-${VERSION}.tar.gz -C temp-deploy/personal-measure-api-${VERSION}
scp temp-deploy/personal-measure-api-${VERSION}/personal_measure_api pmapi@pmapi.jdbernard.com:/home/pmapi/personal_measure_api
rm -r temp-deploy
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://personal-measure.jdbernard.com
rm -r temp-deploy
deploy: deploy-api deploy-web