-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
55 lines (39 loc) · 1.58 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
PROG=bin/stolon-pgbouncer bin/stolon-pgbouncer-acceptance
PROJECT=github.com/gocardless/stolon-pgbouncer
VERSION=$(shell git rev-parse --short HEAD)-dev
BUILD_COMMAND=go build -ldflags "-X main.Version=$(VERSION)"
BASE_TAG=2022042601
CIRCLECI_TAG=20220042601
STOLON_DEVELOPMENT_TAG=2022042601
.PHONY: all darwin linux test clean test-acceptance docker-compose
all: darwin linux
darwin: $(PROG)
linux: $(PROG:=.linux_amd64)
bin/%.linux_amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(BUILD_COMMAND) -a -o $@ cmd/$*/main.go
bin/%:
$(BUILD_COMMAND) -o $@ cmd/$*/main.go
generate:
go generate ./...
# go get -u github.com/onsi/ginkgo/ginkgo
test:
ginkgo -v -r
test-acceptance: docker-compose
go run cmd/stolon-pgbouncer-acceptance/main.go
clean:
rm -rvf $(PROG) $(PROG:%=%.linux_amd64)
docker-compose: clean bin/stolon-pgbouncer.linux_amd64
docker-compose up --no-start
docker-compose start
docker-base: docker/base/Dockerfile
docker build -t gocardless/stolon-pgbouncer-base:$(BASE_TAG) docker/base
docker-circleci: docker/circleci/Dockerfile
docker build -t gocardless/stolon-pgbouncer-circleci:$(CIRCLECI_TAG) docker/circleci
docker-stolon-development: docker/stolon-development/Dockerfile
docker build -t gocardless/stolon-development:$(STOLON_DEVELOPMENT_TAG) docker/stolon-development
publish-base: docker-base
docker push gocardless/stolon-pgbouncer-base:$(BASE_TAG)
publish-circleci: docker-circleci
docker push gocardless/stolon-pgbouncer-circleci:$(CIRCLECI_TAG)
publish-stolon-development: docker-stolon-development
docker push gocardless/stolon-development:$(STOLON_DEVELOPMENT_TAG)