-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (63 loc) · 2.25 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
.PHONY: db-up, setup, db-migrate-local, db-migrate-remote,db-codegen, api-image, start-backend, start-frontend, build-backend, build-frontend, setup-frontend, test-frontend, start-aws-mock, setup-terraform, ci-environment
db-up:
@if ! docker compose ps | grep -q db; then \
docker compose up db -d; \
echo "Waiting for db service to be ready..."; \
until docker compose exec db pg_isready &> /dev/null; \
do \
sleep 1; \
done; \
fi
ci-environment:
@if [ $(CI) ]; then \
env > .env; \
fi
setup: setup-backend setup-frontend
setup-backend: ci-environment db-up db-migrate-local db-codegen
setup-frontend: ci-environment install-frontend open-api-client-gen
setup-terraform:
cd infrastructure && sh ./bin/setup.sh
DB_MIGRATE_COMMAND = docker compose run --rm sqldef psqldef
dry-db-migrate-local:
${DB_MIGRATE_COMMAND} -h db -U root -W password app --file=./volume/schema.sql --dry-run
dry-db-migrate-remote:
${DB_MIGRATE_COMMAND} -h $(DB_HOST) -U $(DB_USER) -W $(DB_PASSWORD) $(DB_NAME) --file=./volume/schema.sql --dry-run
db-migrate-local:
${DB_MIGRATE_COMMAND} -h db -U root -W password app --file=./volume/schema.sql
db-migrate-remote:
${DB_MIGRATE_COMMAND} -h $(DB_HOST) -U $(DB_USER) -W $(DB_PASSWORD) $(DB_NAME) --file=./volume/schema.sql
db-seed:
docker compose exec -d db sh /data/bin/seed.sh
db-codegen:
./gradlew backend:infrastructure:generateJooq
graphql-codegen:
./gradlew backend:api:generateJava
open-api-schema-gen:
./gradlew backend:api:generateOpenApiDocs
open-api-client-gen: open-api-schema-gen
${FRONT_APP_COMMAND} api-code:gen
FRONT_APP_COMMAND = pnpm -F "app"
start-backend:
./gradlew backend:api:bootRun --debug-jvm
run-storybook:
${FRONT_APP_COMMAND} storybook
start-frontend:
${FRONT_APP_COMMAND} dev
build-backend:
./gradlew backend:api:bootJar
install-frontend:
pnpm recursive install
build-frontend:
${FRONT_APP_COMMAND} build
test-frontend:
${FRONT_APP_COMMAND} test
start-aws-mock:
@if ! docker compose ps | grep -q moto-aws-local; then \
docker compose up moto-aws-local -d; \
echo "Waiting for moto-aws-local service to be ready..."; \
until curl --silent http://localhost:4000; \
do \
sleep 1; \
done; \
docker compose run aws-local-cli bash /aws-local-cli/.bin/create-user-pool.sh; \
fi