VERSION:=$(shell git describe --always) TARGET_ENV ?= dev build: dist/personal-measure-api.tar.gz dist/personal-measure-web.tar.gz clean: -rm -r dist -rm -r web/dist -docker container prune -docker image prune update-version: operations/update-version.sh dist/personal-measure-web.tar.gz: -mkdir dist 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 deploy-api: make -C api personal_measure_api-image push-image cd operations/terraform && terraform apply -target module.${TARGET_ENV}_env.aws_ecs_task_definition.pmapi -target module.${TARGET_ENV}_env.aws_ecs_service.pmapi 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-software.com/$(TARGET_ENV)/webroot TARGET_ENV=${TARGET_ENV} operations/invalidate-cdn-cache.sh rm -r temp-deploy deploy: deploy-api deploy-web