-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
27 lines (19 loc) · 1007 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
REPO_SERVER=019120760881.dkr.ecr.us-east-1.amazonaws.com
docker:
$(eval GIT_TAG := $(shell git rev-parse --short HEAD))
docker build --platform linux/amd64 -t "${REPO_SERVER}/probelab:tiros-${GIT_TAG}" .
docker-push: docker
docker push "${REPO_SERVER}/probelab:tiros-${GIT_TAG}"
tools:
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/[email protected]
go install github.com/volatiletech/sqlboiler/[email protected]
go install github.com/volatiletech/sqlboiler/v4/drivers/[email protected]
database:
docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_USER=tiros_test -e POSTGRES_DB=tiros_test --name tiros_test postgres:14
models:
sqlboiler --no-tests psql
migrate-up:
migrate -database 'postgres://tiros_test:password@localhost:5432/tiros_test?sslmode=disable' -path migrations up
migrate-down:
migrate -database 'postgres://tiros_test:password@localhost:5432/tiros_test?sslmode=disable' -path migrations down
.PHONY: tools docker-push models database