-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (33 loc) · 1.5 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
network:
docker network create bank-network
postgres:
docker run --name postgres12 --network bank-network -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
serverdocker:
docker run --name simple_bank -p 8080:8080 -e GIN_MODE=release --network bank-network simple_bank:latest
mysql:
docker run --name mysql8 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -d mysql:8
createdb:
docker exec -it postgres12 createdb --username=root --owner=root simple_bank
dropdb:
docker exec -it postgres12 dropdb simple_bank
migrateup:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose up
migrateup1:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose up 1
migratedown:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose down
migratedown1:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose down 1
sqlc:
sqlc generate
test:
go test -v -cover ./...
server:
go run main.go
mock:
mockgen -package mockdb -destination db/mock/store.go github.com/hhow09/simple_bank/db/sqlc Store
swagger:
swag init -g ./api/server.go
dockercomposerebuild:
docker compose up --force-recreate --build api
.PHONY: network postgres serverdocker createdb dropdb migrateup migratedown migrateup1 migratedown1 sqlc test server mock swagger dockercomposerebuild