-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (20 loc) · 831 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:
@echo "Setting up postgres..."
docker run --name broempSignalDB -e POSTGRES_USER=broempSignal -e POSTGRES_PASSWORD=broempSignal -p 5432:5432 -d postgres:alpine
createdb:
@echo "Creating database..."
docker exec -it broempSignalDB createdb --username=broempSignal --owner=broempSignal broempSignal
dropdb:
@echo "Dropping database..."
docker rm -f broempSignalDB
migrateup:
migrate -path db/migration -database "postgresql://broempSignal:broempSignal@$(DB_URL):5432/broempSignal?sslmode=disable" -verbose up
migratedown:
migrate -path db/migration -database "postgresql://broempSignal:broempSignal@$(DB_URL):5432/broempSignal?sslmode=disable" -verbose down
sqlc:
sqlc generate
test:
go test -v -cover ./...
server:
go run main.go
.PHONY: createdb dropdb postgres migrateup migratedown sqlc test server