NestJS-VueJS-AWS-template/Makefile

38 lines
756 B
Makefile

# here put the global rules to deploy globally the app for dev/prod env
# deploy DEV
# -> deploy AWS resources
# -> run backed dev mode
# -> run frontend dev mode
# deploy personal ?
# deploy PRD
# -> deploy AWS resources
# -> build backend
# -> deploy backed
# -> build frontend
# -> deploy frontend
# TODO
# help command
check_env:
ifndef ENV
$(error "ENV is undefined")
endif
infra_init: check_env
cd infra/ && terraform init
cd infra/ && terraform workspace new $(ENV) || terraform workspace select $(ENV)
infra_plan: infra_init
cd infra/ && terraform plan -input=false
infra: infra_plan
cd infra/ && terraform apply -auto-approve
cd infra/ && terraform output > ../back/.env
infra_destroy:
cd infra/ && terraform destroy -auto-approve