-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (19 loc) · 862 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
postgres:
docker run --name postgres --network hb-network -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres
backend:
docker run --name HB-Backend --network hb-network -e DB_SOURCE="postgresql://root:secret@postgres:5432/hb?sslmode=disable" -e GIN_MODE=release -p 8080:8080 hb:latest
createdb:
docker exec -it postgres createdb --username=root --owner=root hb
dropdb:
docker exec -it postgres dropdb hb
migrateup:
migrate -path internal/db/migration -database "postgresql://root:secret@localhost:5432/hb?sslmode=disable" -verbose up
migratedown:
migrate -path internal/db/migration -database "postgresql://root:secret@localhost:5432/hb?sslmode=disable" -verbose down
sqlc:
sqlc generate
test:
go test -v -cover ./...
server:
go run cmd/app/main.go
.PHONY: createdb dropdb migrateup migratedown postgres sqlc test server