-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (65 loc) · 2.04 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
include .env
DOCKER_RUN_CLIENT=docker compose run --rm client
DOCKER_RUN_API=docker compose run --rm api
POSTGRESQL_ADMIN_URL=postgres://$(POSTGRES_ADMIN_USER):$(POSTGRES_ADMIN_PASSWORD)@db:$(POSTGRES_PORT)/$(POSTGRES_DB)?sslmode=disable
build:
docker compose build
up:
docker compose up -d
down:
docker compose down
down_all:
docker compose down --rmi all --volumes --remove-orphans
ps:
docker compose ps
psql:
docker compose exec db psql -U $(POSTGRES_ADMIN_USER) -d $(POSTGRES_DB)
migrate_create:
$(DOCKER_RUN_API) migrate create -ext sql -dir internal/db/migration -seq $(NAME)
migrate_up:
$(DOCKER_RUN_API) migrate -path internal/db/migration -database $(POSTGRESQL_ADMIN_URL) -verbose up
migrate_down:
$(DOCKER_RUN_API) migrate -path internal/db/migration -database $(POSTGRESQL_ADMIN_URL) -verbose down $(STEP)
migrate_drop:
$(DOCKER_RUN_API) migrate -path internal/db/migration -database $(POSTGRESQL_ADMIN_URL) -verbose drop
migrate_version:
$(DOCKER_RUN_API) migrate -path internal/db/migration -database $(POSTGRESQL_ADMIN_URL) version
sqlc_gen:
$(DOCKER_RUN_API) sqlc generate
sqlc_vet:
$(DOCKER_RUN_API) sqlc vet
tidy:
$(DOCKER_RUN_API) go mod tidy
fmt:
$(DOCKER_RUN_API) go fmt ./...
lint:
$(DOCKER_RUN_CLIENT) npm run lint:fix
$(DOCKER_RUN_API) golangci-lint run
lint_v:
$(DOCKER_RUN_API) golangci-lint run -v
test:
$(DOCKER_RUN_API) go test -cover ./...
test_v:
$(DOCKER_RUN_API) go test -v -cover ./...
build_client:
$(DOCKER_RUN_CLIENT) npm run build
npm_infra-ts:
npm $(CMD) --prefix ./infra-ts
npm_i_infra-ts:
npm i --prefix ./infra-ts
cdk:
npm run cdk $(CMD) --prefix ./infra-ts
cdk_bootstrap:
npm run cdk:bootstrap --prefix ./infra-ts
cdk_deploy:
npm run cdk:deploy $(STACK) --prefix ./infra-ts
cdk_deploy_all:
npm run cdk:deploy:all --prefix ./infra-ts
cdk_rollback:
npm run cdk:rollback $(STACK) --prefix ./infra-ts
cdk_rollback_all:
npm run cdk:rollback:all --prefix ./infra-ts
cdk_destroy:
npm run cdk:destroy $(STACK) --prefix ./infra-ts
cdk_destroy_all:
npm run cdk:destroy:all --prefix ./infra-ts