-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 822 Bytes
/
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
# Load .env configurations
ifneq (,$(wildcard ./auth/cmd/.env))
export
MIGRATIONS_SOURCE = file://db/migrations
DATABASE_URL = postgres://$(DB_USERNAME):$(DB_PASSWORD)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)
endif
# Run & Build entire services
run:
docker compose up -d --build --force-recreate
# Stop entire services
stop:
docker compose down
# Remove entire services
remove:
docker compose down -v
# Run golang-migrate up
migrate-up:
migrate -source $(MIGRATIONS_SOURCE) -database "$(DATABASE_URL)" up
# Run golang-migrate down
migrate-down:
migrate -source $(MIGRATIONS_SOURCE) -database "$(DATABASE_URL)" down -all
# Run golang-migrate create
migrate-create:
migrate create -ext sql -dir ./db/migrations $(filter-out $@,$(MAKECMDGOALS))
# Run linters
lint:
golangci-lint run
.PHONY: run stop remove