forked from CrunchyData/crunchy-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
114 lines (109 loc) · 4.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
ifndef BUILDBASE
export BUILDBASE=$(GOPATH)/src/github.com/crunchydata/crunchy-containers
endif
versiontest:
if test -z "$$CCP_PGVERSION"; then echo "CCP_PGVERSION undefined"; exit 1;fi;
if test -z "$$CCP_BASEOS"; then echo "CCP_BASEOS undefined"; exit 1;fi;
if test -z "$$CCP_VERSION"; then echo "CCP_VERSION undefined"; exit 1;fi;
setup:
$(BUILDBASE)/bin/install-deps.sh
gendeps:
godep save \
github.com/crunchydata/crunchy-containers/collectapi \
github.com/crunchydata/crunchy-containers/dnsbridgeapi \
github.com/crunchydata/crunchy-containers/badger
docbuild:
cd docs && ./build-docs.sh
postgres:
make versiontest
docker build -t crunchy-postgres -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.postgres.$(CCP_BASEOS) .
docker tag -f crunchy-postgres crunchydata/crunchy-postgres:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
watch:
cp /usr/bin/oc bin/watch
cp /usr/bin/kubectl bin/watch
docker build -t crunchy-watch -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.watch.$(CCP_BASEOS) .
docker tag -f crunchy-watch crunchydata/crunchy-watch:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
version:
docker build -t crunchy-version -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.version.$(CCP_BASEOS) .
docker tag -f crunchy-version crunchydata/crunchy-version:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
pgbouncer:
make versiontest
cp /usr/bin/oc bin/pgbouncer
cp /usr/bin/kubectl bin/pgbouncer
cd bounce && godep go install bounce.go
cp $(GOBIN)/bounce bin/pgbouncer/
sudo docker build -t crunchy-pgbouncer -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.pgbouncer.$(CCP_BASEOS) .
docker tag -f crunchy-pgbouncer crunchydata/crunchy-pgbouncer:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
pgpool:
make versiontest
sudo docker build -t crunchy-pgpool -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.pgpool.$(CCP_BASEOS) .
docker tag -f crunchy-pgpool crunchydata/crunchy-pgpool:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
pgbadger:
make versiontest
cd badger && godep go install badgerserver.go
cp $(GOBIN)/badgerserver bin/pgbadger
sudo docker build -t crunchy-pgbadger -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.pgbadger.$(CCP_BASEOS) .
docker tag -f crunchy-pgbadger crunchydata/crunchy-pgbadger:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
collectserver:
make versiontest
cd collect && godep go install collectserver.go
cp $(GOBIN)/collectserver bin/collect
sudo docker build -t crunchy-collect -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.collect.$(CCP_BASEOS) .
docker tag -f crunchy-collect crunchydata/crunchy-collect:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
dns:
cd dnsbridge && godep go install dnsbridgeserver.go
cd dnsbridge && godep go install consulclient.go
cp $(GOBIN)/consul bin/dns/
cp $(GOBIN)/dnsbridgeserver bin/dns/
cp $(GOBIN)/consulclient bin/dns/
sudo docker build -t crunchy-dns -f $(CCP_BASEOS)/Dockerfile.dns.$(CCP_BASEOS) .
docker tag -f crunchy-dns crunchydata/crunchy-dns:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
backup:
make versiontest
sudo docker build -t crunchy-backup -f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.backup.$(CCP_BASEOS) .
docker tag -f crunchy-backup crunchydata/crunchy-backup:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
prometheus:
make versiontest
sudo docker build -t crunchy-prometheus -f $(CCP_BASEOS)/Dockerfile.prometheus.$(CCP_BASEOS) .
docker tag -f crunchy-prometheus crunchydata/crunchy-prometheus:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
promgateway:
make versiontest
sudo docker build -t crunchy-promgateway -f $(CCP_BASEOS)/Dockerfile.promgateway.$(CCP_BASEOS) .
docker tag -f crunchy-promgateway crunchydata/crunchy-promgateway:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
grafana:
make versiontest
sudo docker build -t crunchy-grafana -f $(CCP_BASEOS)/Dockerfile.grafana.$(CCP_BASEOS) .
docker tag -f crunchy-grafana crunchydata/crunchy-grafana:$(CCP_BASEOS)-$(CCP_PGVERSION)-$(CCP_VERSION)
all:
make versiontest
make postgres
make backup
make watch
make pgpool
make pgbouncer
make pgbadger
make collectserver
make dns
make grafana
make promgateway
make prometheus
push:
./bin/push-to-dockerhub.sh
default:
all
test:
./tests/standalone/test-master.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-replica.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-pgpool.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-backup.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-restore.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-watch.sh; /usr/bin/test "$$?" -eq 0
./tests/standalone/test-badger.sh; /usr/bin/test "$$?" -eq 0
sudo docker stop master
testopenshift:
./tests/openshift/test-master.sh; /usr/bin/test "$$?" -eq 0
./tests/openshift/test-replica.sh; /usr/bin/test "$$?" -eq 0
./tests/openshift/test-pgpool.sh; /usr/bin/test "$$?" -eq 0
./tests/openshift/test-watch.sh; /usr/bin/test "$$?" -eq 0
./tests/openshift/test-scope.sh; /usr/bin/test "$$?" -eq 0
./tests/openshift/test-backup.sh; /usr/bin/test "$$?" -eq 0