forked from jschaf/pggen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (51 loc) · 1.54 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SHELL := bash
.SHELLFLAGS := -euo pipefail -c
.ONESHELL: # use a single shell for commands instead a new shell per line
.DELETE_ON_ERROR: # delete output files when make rule fails
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: all
all: lint test acceptance-test
.PHONY: start
start:
docker-compose up -d
.PHONY: stop
stop:
docker-compose down
.PHONY: restart
restart: stop start
.PHONY: psql
psql:
PGPASSWORD=hunter2 psql --host=127.0.0.1 --port=5555 --username=postgres pggen
.PHONY: test
test:
go test ./...
.PHONY: acceptance-test
acceptance-test:
DOCKER_API_VERSION=1.39 go test ./example/acceptance_test.go
.PHONY: update-acceptance-test
update-acceptance-test:
DOCKER_API_VERSION=1.39 go test ./example/acceptance_test.go -update
.PHONY: lint
lint:
golangci-lint run
.PHONY: binary-all
binary-all: binary-darwin-amd64 binary-darwin-arm64 binary-linux-amd64 binary-windows-amd64
.PHONY: dist-dir
dist-dir:
mkdir -p dist
.PHONY: binary-darwin-amd64
binary-darwin-amd64: dist-dir
GOOS=darwin GOARCH=amd64 go build -o dist/pggen-darwin-amd64 ./cmd/pggen
.PHONY: binary-darwin-arm64
binary-darwin-arm64: dist-dir
GOOS=darwin GOARCH=arm64 go build -o dist/pggen-darwin-arm64 ./cmd/pggen
.PHONY: binary-linux-amd64
binary-linux-amd64: dist-dir
GOOS=linux GOARCH=amd64 go build -o dist/pggen-linux-amd64 ./cmd/pggen
.PHONY: binary-windows-amd64
binary-windows-amd64: dist-dir
GOOS=windows GOARCH=amd64 go build -o dist/pggen-windows-amd64.exe ./cmd/pggen
.PHONY: release
release: binary-all
./script/release.sh