forked from lineupninja/hasura-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (25 loc) · 1023 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
define HELP
Usage:
make build - Build
make deploy - Deploy
endef
export HELP
EXECUTION_DATE:=$(shell date +'%Y%m%d%H%M')
include .env
all help:
@echo "$$HELP"
dependencies:
cd actions; npm install
cd cdk; npm install
build: dependencies build-actions build-cdk
build-actions:
cd actions; npm run build
build-cdk:
cd cdk; npm run build
deploy: build deploy-cdk post-deploy-cdk
deploy-cdk:
cd cdk; AWS_ACCOUNT_ID=${AWS_ACCOUNT_ID} AWS_REGION=${AWS_REGION} HOSTED_ZONE_NAME=${HOSTED_ZONE_NAME} HOSTED_ZONE_ID=${HOSTED_ZONE_ID} HASURA_HOSTNAME=${HASURA_HOSTNAME} ACTIONS_HOSTNAME=${ACTIONS_HOSTNAME} APP_NAME=${APP_NAME} npx cdk deploy '*' --profile ${AWS_PROFILE} --outputs-file cdk.outputs.json
post-deploy-cdk:
@cd cdk; AWS_PROFILE=${AWS_PROFILE} AWS_REGION=${AWS_REGION} APP_NAME=${APP_NAME} HASURA_ADMIN_SECRET=${HASURA_ADMIN_SECRET} HASURA_JWT_SECRET=${HASURA_JWT_SECRET} npx ts-node bin/post-deploy.ts
deploy-schema:
cd hasura; hasura migrate apply