-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (32 loc) · 1.09 KB
/
Copy pathmakefile
File metadata and controls
45 lines (32 loc) · 1.09 KB
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
-include .env
DB_URL = "postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DBNAME)?sslmode=$(POSTGRES_SSLMODE)"
MIGRATION_DIR = "./api/sqlc/migrations"
migration:
@goose -dir $(MIGRATION_DIR) create $(filter-out $@,$(MAKECMDGOALS)) sql
migration-status:
@goose postgres -dir $(MIGRATION_DIR) $(DB_URL) status
migration-up:
@goose postgres -dir $(MIGRATION_DIR) $(DB_URL) up
migration-down:
@goose postgres -dir $(MIGRATION_DIR) $(DB_URL) down
migration-reset:
@goose postgres -dir $(MIGRATION_DIR) $(DB_URL) reset
compose-up:
@docker compose --env-file .env -f ./docker/dev/docker-compose.dev.yml up -d
compose-down:
@docker compose --env-file .env -f ./docker/dev/docker-compose.dev.yml down -v
buildx:
@docker buildx build -f ./docker/prod/Dockerfile --platform linux/amd64 -t cloudmesh-api .
dev:
@pnpm -C app install
$(MAKE) compose-up
@sleep 2
@pnpm -C app db:generate
@pnpm -C app db:migrate
$(MAKE) migration-up
lint:
@cd api && golangci-lint run --fix
# @pnpm -C app lint
format:
@cd api && golangci-lint fmt
# @pnpm -C app format