-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
53 lines (39 loc) · 1.37 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
.PHONY: all server clean run* dynamo* ngrok docker*
server:
rm -rf dist
yarn run tsc -p tsconfig.build.json
#
# Runners
#
ngrok:
# Let ngrok handle HTTPS. Vaild SSL cert needed for mobile dev. @see https://rynop.com/2019/05/09/howto-mobile-development-against-a-localhost-https-api/
ngrok http -bind-tls=true -subdomain=$(shell hostname)-my-platform-api 8081
run/local-dev-server: dynamo/up
yarn run start:dev
run/watch:
yarn run watch
run/sam-start-api: dynamo/up
sam local start-api -t aws/cloudformation/sam-template.yml --skip-pull-image --profile default \
--docker-network abp-sam-backend \
--parameter-overrides 'ParameterKey=StageName,ParameterValue=local ParameterKey=DDBTableName,ParameterValue=local-SingleTable ParameterKey=SomeSecretInSSM,ParameterValue=SecretSetInSamLocalParameterOverrides'
run/prod: server
node dist/main.js
#
# Docker commands
#
dynamo/up:
cd docker && docker-compose up -d dynamo
# Load local DynamoDB with sample data (dropping table if exists)
dynamo/init: dynamo/up
./dynamodb/create-schema-locally.sh
./dynamodb/load-data-locally.sh SingleTable
dynamo/down:
cd docker && docker-compose stop dynamo
docker/down:
cd docker && docker-compose down
# Do this in lieu of docker/down @see https://docs.docker.com/compose/reference/down/
docker/remove-volume:
cd docker && docker-compose down --volumes
clean:
rm -rf dist
rm -rf deploy