-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
105 lines (93 loc) · 3.01 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
GREEN=\033[0;32m
NC=\033[0m
## Prepare ##
prepare:
(command -v husky && husky) || true
install-concurrently:
npm i -g concurrently
npm-install:
npm i
## env files ##
update-env:
MODE=update node scripts/init-env.mjs
init-env:
node scripts/init-env.mjs
## Build packages ##
init-packages: npm-install
## Docker ##
build-docker:
docker build -t base-deps:latest --file Dockerfile .
init: init-packages init-env build-docker
start-docker:
docker compose down && \
DOCKER_BUILDKIT=1 docker compose up --build --remove-orphans -d --wait
reset-docker:
docker compose down && \
docker system prune -a -f && \
docker builder prune -f && \
docker image prune -f
## Migrations
migrate:
npm run migrate --workspace=web && \
npm run migrate --workspace=payments-api && \
npm run migrate --workspace=journey-api && \
npm run migrate --workspace=messaging-api && \
npm run migrate --workspace=profile-api && \
npm run migrate --workspace=profile && \
npm run migrate --workspace=scheduler-api && \
npm run migrate --workspace=upload-api && \
npm run migrate --workspace=dashboard-admin
## Logto ##
init-logto:
node scripts/init-logto.mjs
stop-logto:
node scripts/stop-logto.mjs
## Run services ##
start-docs:
cd documentation && \
npm run start && \
cd ..
run-services:
concurrently --kill-others-on-fail \
"npm run dev --workspace=auth-service" \
"npm run dev --workspace=mock-api" \
"npm run dev --workspace=web" \
"npm run dev --workspace=payments" \
"npm run dev --workspace=messaging" \
"npm run dev --workspace=payments-api" \
"npm run dev --workspace=profile" \
"npm run dev --workspace=messaging-api" \
"npm run dev --workspace=profile-api" \
"npm run dev --workspace=timeline-api" \
"npm run dev --workspace=home" \
"npm run dev --workspace=forms" \
"npm run dev --workspace=upload" \
"npm run dev --workspace=upload-api" \
"npm run dev --workspace=scheduler-api" \
"npm run dev --workspace=journey" \
"npm run dev --workspace=journey-api" \
"npm run dev --workspace=dashboard" \
"npm run dev --workspace=dashboard-admin"
start-services: install-concurrently run-services
kill-services:
sleep 2 && lsof -ti:8000,8001,8002,8003,8004,8005,8006,8009,3000,3001,3002,3003,3004,3005,3006,3008,3009,3010,3011,3012 | xargs sudo kill -9
kill-logto:
sleep 2 && lsof -ti:3301,3302 | xargs sudo kill -9
kill-all: install-concurrently concurrently kill-services kill-logto
start-migrate:
$(MAKE) install-concurrently && \
concurrently \
"$(MAKE) start-services" \
"sleep 5 && $(MAKE) migrate"
start-migrate-logto:
$(MAKE) install-concurrently && \
concurrently \
"$(MAKE) start-services" \
"$(MAKE) init-logto" \
"sleep 5 && $(MAKE) migrate"
start: init start-docker start-migrate
start-logto: init start-docker start-migrate-logto
security-privacy-report:
docker run --rm -v $(shell pwd):/tmp/scan bearer/bearer:latest scan --report privacy -f html /tmp/scan > bearer-privacy-report.html
security-scan:
docker run --rm -v $(shell pwd):/tmp/scan bearer/bearer:latest scan -f html /tmp/scan > bearer-scan-report.html