forked from CrunchyData/postgres-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
125 lines (120 loc) · 5.01 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
114
115
116
117
118
119
120
121
122
123
124
RELTMPDIR=/tmp/release.$(CO_VERSION)
RELFILE=/tmp/postgres-operator.$(CO_VERSION).tar.gz
#======= Safety checks =======
check-go-vars:
ifndef GOPATH
$(error GOPATH is not set)
endif
ifndef GOBIN
$(error GOBIN is not set)
endif
#======= Main functions =======
macpgo: check-go-vars
cd pgo && env GOOS=darwin GOARCH=amd64 go build pgo.go && mv pgo $(GOBIN)/pgo-mac
env GOOS=darwin GOARCH=amd64 go build github.com/blang/expenv && mv expenv $(GOBIN)/expenv-mac
winpgo: check-go-vars
cd pgo && env GOOS=windows GOARCH=386 go build pgo.go && mv pgo.exe $(GOBIN)/pgo.exe
env GOOS=windows GOARCH=386 go build github.com/blang/expenv && mv expenv.exe $(GOBIN)/expenv.exe
gendeps:
godep save \
github.com/crunchydata/postgres-operator/apis/cr/v1 \
github.com/crunchydata/postgres-operator/util \
github.com/crunchydata/postgres-operator/operator \
github.com/crunchydata/postgres-operator/operator/backup \
github.com/crunchydata/postgres-operator/operator/cluster \
github.com/crunchydata/postgres-operator/operator/pvc \
github.com/crunchydata/postgres-operator/controller \
github.com/crunchydata/postgres-operator/client \
github.com/crunchydata/postgres-operator/pgo/cmd \
github.com/crunchydata/postgres-operator/apiservermsgs \
github.com/crunchydata/postgres-operator/apiserver \
github.com/crunchydata/postgres-operator/apiserver/backupservice \
github.com/crunchydata/postgres-operator/apiserver/cloneservice \
github.com/crunchydata/postgres-operator/apiserver/clusterservice \
github.com/crunchydata/postgres-operator/apiserver/labelservice \
github.com/crunchydata/postgres-operator/apiserver/loadservice \
github.com/crunchydata/postgres-operator/apiserver/policyservice \
github.com/crunchydata/postgres-operator/apiserver/pvcservice \
github.com/crunchydata/postgres-operator/apiserver/upgradeservice \
github.com/crunchydata/postgres-operator/apiserver/userservice \
github.com/crunchydata/postgres-operator/apiserver/util \
github.com/crunchydata/postgres-operator/apiserver/versionservice
setup:
./bin/get-deps.sh
deployoperator:
cd deploy && ./deploy.sh
main: check-go-vars
go install postgres-operator.go
runmain: check-go-vars
postgres-operator --kubeconfig=/etc/kubernetes/admin.conf
runapiserver: check-go-vars
apiserver --kubeconfig=/etc/kubernetes/admin.conf
apiserver: check-go-vars
go install apiserver.go
pgo: check-go-vars
cd pgo && go install pgo.go
clean: check-go-vars
rm -rf $(GOPATH)/pkg/* $(GOBIN)/postgres-operator $(GOBIN)/apiserver $(GOBIN)/*pgo
apiserverimage: check-go-vars
go install apiserver.go
cp $(GOBIN)/apiserver bin/
docker build -t pgo-apiserver -f $(CO_BASEOS)/Dockerfile.pgo-apiserver.$(CO_BASEOS) .
docker tag pgo-apiserver $(CO_IMAGE_PREFIX)/pgo-apiserver:$(CO_BASEOS)-$(CO_VERSION)
# docker push $(CO_IMAGE_PREFIX)/pgo-apiserver:$(CO_IMAGE_TAG)
operator: check-go-vars
go install postgres-operator.go
operatorimage: check-go-vars
go install postgres-operator.go
cp $(GOBIN)/postgres-operator bin/postgres-operator/
docker build -t postgres-operator -f $(CO_BASEOS)/Dockerfile.postgres-operator.$(CO_BASEOS) .
docker tag postgres-operator $(CO_IMAGE_PREFIX)/postgres-operator:$(CO_BASEOS)-$(CO_VERSION)
# docker push $(CO_IMAGE_PREFIX)/postgres-operator:$(CO_IMAGE_TAG)
deepsix:
cd $(COROOT)/apis/cr/v1
deepcopy-gen --go-header-file=$(COROOT)/apis/cr/v1/header.go.txt --input-dirs=.
lsimage:
docker build -t pgo-lspvc -f $(CO_BASEOS)/Dockerfile.pgo-lspvc.$(CO_BASEOS) .
docker tag pgo-lspvc $(CO_IMAGE_PREFIX)/pgo-lspvc:$(CO_BASEOS)-$(CO_VERSION)
loadimage:
docker build -t pgo-load -f $(CO_BASEOS)/Dockerfile.pgo-load.$(CO_BASEOS) .
docker tag pgo-load $(CO_IMAGE_PREFIX)/pgo-load:$(CO_BASEOS)-$(CO_VERSION)
rmdataimage:
docker build -t pgo-rmdata -f $(CO_BASEOS)/Dockerfile.pgo-rmdata.$(CO_BASEOS) .
docker tag pgo-rmdata $(CO_IMAGE_PREFIX)/pgo-rmdata:$(CO_BASEOS)-$(CO_VERSION)
all:
make operatorimage
make apiserverimage
make lsimage
make loadimage
make pgo
make rmdataimage
push:
docker push $(CO_IMAGE_PREFIX)/pgo-lspvc:$(CO_IMAGE_TAG)
docker push $(CO_IMAGE_PREFIX)/pgo-rmdata:$(CO_IMAGE_TAG)
docker push $(CO_IMAGE_PREFIX)/pgo-load:$(CO_IMAGE_TAG)
docker push $(CO_IMAGE_PREFIX)/postgres-operator:$(CO_IMAGE_TAG)
docker push $(CO_IMAGE_PREFIX)/pgo-apiserver:$(CO_IMAGE_TAG)
pull:
docker pull $(CO_IMAGE_PREFIX)/pgo-lspvc:$(CO_IMAGE_TAG)
docker pull $(CO_IMAGE_PREFIX)/pgo-rmdata:$(CO_IMAGE_TAG)
docker pull $(CO_IMAGE_PREFIX)/pgo-load:$(CO_IMAGE_TAG)
docker pull $(CO_IMAGE_PREFIX)/postgres-operator:$(CO_IMAGE_TAG)
docker pull $(CO_IMAGE_PREFIX)/pgo-apiserver:$(CO_IMAGE_TAG)
release: check-go-vars
make macpgo
make winpgo
rm -rf $(RELTMPDIR) $(RELFILE)
mkdir $(RELTMPDIR)
cp -r $(COROOT)/examples $(RELTMPDIR)
cp -r $(COROOT)/deploy $(RELTMPDIR)
cp -r $(COROOT)/conf $(RELTMPDIR)
cp $(GOBIN)/pgo $(RELTMPDIR)
cp $(GOBIN)/pgo-mac $(RELTMPDIR)
cp $(GOBIN)/pgo.exe $(RELTMPDIR)
cp $(GOBIN)/expenv $(RELTMPDIR)
cp $(GOBIN)/expenv-mac $(RELTMPDIR)
cp $(GOBIN)/expenv.exe $(RELTMPDIR)
cp $(COROOT)/examples/pgo-bash-completion $(RELTMPDIR)
tar czvf $(RELFILE) -C $(RELTMPDIR) .
default:
all