-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (34 loc) · 1.03 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
# Run the app with air for live reload support
dev:
air -c .air.toml
tidy:
go mod tidy
lint:
golangci-lint run
test:
go test -race -v -count=1 ./... -cover
build:
@echo "Building binary..."
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./cmd/app/main ./cmd/app/main.go
@echo "Build completed successfully..."
run:
./cmd/app/main
# Metrics service docker compose
metrics\:start:
@echo "Starting metrics service..."
@if ! docker compose -f ./docker/compose.yml start; then \
echo "Make sure you already build the metrics service"; \
exit 1; \
fi
metrics\:stop:
docker compose -f ./docker/compose.yml stop
metrics\:build:
docker compose -f ./docker/compose.yml up -d --build
metrics\:delete:
docker compose -f ./docker/compose.yml down
# Makesure you have goose binary installed
migrate\:create:
@echo "Create Migration"
@read -p "Enter migration name: " migration_name; \
goose -dir database/migrations create $$migration_name sql
@echo "Migration created successfully, fill in the schema in the generated file."