-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
202 lines (179 loc) · 7.83 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Define Default if Values not exist
BASE_IMAGE ?= rockylinux:9
BASEOS ?= rocky9
CONTAINERIMAGE ?= rockylinux/rockylinux:9-ubi-micro
IMAGE_REPOSITORY ?= docker.io
IMAGE_PATH ?= cybertec-pg-container
CONTAINERSUITE ?= cybertec-pg-container
PGVERSION ?= 17
PGVERSION_FULL ?= 17.0
OLD_PG_VERSIONS ?= 13 14 15 16
PATRONI_VERSION ?= multisite-4.0.2.1
PGBACKREST_VERSION ?= 2.53
POSTGIS_VERSION ?= 34
ETCD_VERSION ?= 3.5.15
PACKAGER ?= dnf
BUILD ?= 2
ARCH ?= amd64
IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD)
POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD)
# Public-Beta
PUBLICBETA ?= 2
BETAVERSION ?= 17
# Settings for the Build-Process
BUILDWITH ?= docker
ROOTPATH ?= $(GOPATH)/src/github.com/cybertec/cybertec-pg-container
# Build Images
all: base pgbackrest postgres
base: base
pgbackrest: pgbackrest
postgres: base postgres
postgres-stage: base postgres-stage
postgres-gis: base postgres-gis
postgres-oracle: base postgres-oracle
pgbouncer: pgbouncer
exporter: exporter
publicbeta: publicbeta-pg publicbeta-pgbackrest
base-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/base/Dockerfile \
--tag cybertec-pg-container/base:$(BASEOS)-$(BUILD) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE)
base: base-build;
pgbackrest-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/pgbackrest/Dockerfile \
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(PGVERSION) \
--build-arg ARCH=$(ARCH)
pgbackrest: pgbackrest-build;
postgres-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/postgres/Dockerfile \
--tag cybertec-pg-container/postgres:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(PGVERSION) \
--build-arg ETCD_VERSION=$(ETCD_VERSION) \
--build-arg PGVERSION=$(PGVERSION) \
--build-arg ARCH=$(ARCH)
postgres: postgres-build
postgres-gis-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/postgres-gis/Dockerfile \
--tag cybertec-pg-container/postgres-gis:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(PGVERSION) \
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
--build-arg ETCD_VERSION=$(ETCD_VERSION) \
--build-arg ARCH=$(ARCH)
postgres-gis: postgres-gis-build
postgres-oracle-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/postgres-oracle/Dockerfile \
--tag cybertec-pg-container/postgres-oracle:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(PGVERSION) \
--build-arg ETCD_VERSION=$(ETCD_VERSION) \
--build-arg ARCH=$(ARCH)
postgres-oracle: postgres-oracle-build
pgbouncer-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/pgbouncer/Dockerfile \
--tag cybertec-pg-container/pgbouncer:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGVERSION=$(PGVERSION)
pgbouncer: pgbouncer-build
exporter-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/exporter/Dockerfile \
--tag cybertec-pg-container/exporter:$(IMAGE_TAG) \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg PGVERSION=$(PGVERSION)
exporter: exporter-build
publicbeta-pg-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/pg-public-beta/Dockerfile \
--tag cybertec-pg-container/postgres:$(IMAGE_TAG)-beta${PUBLICBETA} \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(BETAVERSION) \
--build-arg ETCD_VERSION=$(ETCD_VERSION) \
--build-arg ARCH=$(ARCH)
publicbeta-pg: publicbeta-pg-build
publicbeta-pgbackrest-build:
docker build $(ROOTPATH) \
--file $(ROOTPATH)/docker/pgbackrest-public-beta/Dockerfile \
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG)-beta${PUBLICBETA} \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
--build-arg BASEOS=$(BASEOS) \
--build-arg PACKAGER=$(PACKAGER) \
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
--build-arg BUILD=$(BUILD) \
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
--build-arg PGVERSION=$(BETAVERSION) \
--build-arg ARCH=$(ARCH)
publicbeta-pgbackrest: publicbeta-pgbackrest-build;