37 lines
1.2 KiB
Makefile
Executable File
37 lines
1.2 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:
|
|
make -C api build-image push-image
|
|
cd operations/terraform && terraform apply -target module.${TARGET_ENV}_env.aws_ecs_task_definition.hff_entry_forms_api -target module.${TARGET_ENV}_env.aws_ecs_service.hff_entry_forms_api
|
|
|
|
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
|