Minor updates to Makefile to better support multiple environment targets.
This commit is contained in:
parent
219796f9e2
commit
955f83b8ad
19
Makefile
19
Makefile
@ -1,11 +1,10 @@
|
||||
VERSION:=$(shell git describe --always)
|
||||
TARGET_ENV ?= dev
|
||||
|
||||
build: dist/hff-entry-forms-api.tar.gz dist/hff-entry-forms-web.tar.gz
|
||||
build: api-image dist/hff-entry-forms-web.${TARGET_ENV}.tar.gz
|
||||
|
||||
clean:
|
||||
-rm -r dist
|
||||
-rm -r web/dist
|
||||
make -C api clean
|
||||
make -C web clean
|
||||
|
||||
@ -15,20 +14,22 @@ test:
|
||||
update-version:
|
||||
operations/update-version.sh
|
||||
|
||||
dist/hff-entry-forms-web.tar.gz:
|
||||
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}.tar.gz -C web/dist .
|
||||
cp dist/hff-entry-forms-web-${VERSION}.tar.gz dist/hff-entry-forms-web.tar.gz
|
||||
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.tar.gz
|
||||
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}.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
|
||||
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
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Hope Family Fellowship entry forms."
|
||||
license = "GPL-3.0-or-later"
|
||||
|
@ -1 +1 @@
|
||||
const HFF_ENTRY_FORMS_API_VERSION* = "0.3.0"
|
||||
const HFF_ENTRY_FORMS_API_VERSION* = "0.3.1"
|
2
web/package-lock.json
generated
2
web/package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hff-entry-form-web",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hff-entry-form-web",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "npx servor dist",
|
||||
|
Loading…
Reference in New Issue
Block a user