hff-entry-forms/Makefile

36 lines
1.0 KiB
Makefile
Executable File

VERSION:=$(shell git describe --always)
TARGET_ENV ?= dev
build: api-image dist/hff-entry-forms-web.${TARGET_ENV}.tar.gz
clean:
-rm -r dist
make -C api clean
make -C web clean
test:
(cd api && nimble unittest)
update-version:
operations/update-version.sh
api-image:
make -C api build-image
dist/hff-entry-forms-web-${VERSION}.${TARGET_ENV}.tar.gz:
-mkdir dist
TARGET_ENV=${TARGET_ENV} make -C web build
tar czf dist/hff-entry-forms-web-${VERSION}.${TARGET_ENV}.tar.gz -C web/dist .
deploy-api:
TARGET_ENV=${TARGET_ENV} make -C api build-image push-image publish
deploy-web: dist/hff-entry-forms-web-${VERSION}.${TARGET_ENV}.tar.gz
mkdir -p temp-deploy/hff-entry-forms-web-${VERSION}
tar xzf dist/hff-entry-forms-web-${VERSION}.${TARGET_ENV}.tar.gz -C temp-deploy/hff-entry-forms-web-${VERSION}
aws s3 sync temp-deploy/hff-entry-forms-web-${VERSION} s3://forms.hopefamilyfellowship.com/${TARGET_ENV}/webroot
TARGET_ENV=${TARGET_ENV} operations/invalidate-cdn-cache.sh
rm -r temp-deploy
deploy: test deploy-api deploy-web