-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.sh
226 lines (178 loc) · 7.42 KB
/
build.sh
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#!/bin/bash -e
#
BASE=lol
SEVEN=0
EIGHT=0
EIGHTONE=0
EIGHTTWO=1
EIGHTTHREE=1
EIGHTFOUR=0
BASE7=3.15-202203-01
BASE8=3.16
BASE81=3.19
BASE82=3.20
BASE83=3.20
BASE84=3.20
VERSION=7.4.33-r1
VERSION8=8.0.30-r0
VERSION81=8.1.30-r0
VERSION82=8.2.26-r0
VERSION83=8.3.14-r0
VERSION84=8.4.1-r0
EXTRAVERSION=-202412-01
STABILITY=stable
REGISTRY=public.ecr.aws/unocha
# Is there a version?
if [ -z "${VERSION}" ]; then
echo "The scripts require a non-empty version string."
exit 1
fi
# Is there an extra version?
if [ -z "${EXTRAVERSION}" ]; then
echo "The scripts require a non-empty extraversion string."
exit 1
fi
# Login, so we can pull and push.
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/unocha
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/v2/unocha
if [ ${SEVEN} -eq 1 ]; then
PHP=7
# First off, we build the base php 7 image.
pushd php/base/php7 && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE7} buildx && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=7.4-${STABILITY} tagx && \
popd
# Build the standard php 7 image.
pushd php/php7 && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION}${EXTRAVERSION} buildx && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=7.4-${STABILITY} tagx && \
popd
# Build the k8s php 7 image.
pushd php/php-k8s-v7 && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION}${EXTRAVERSION} buildx && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=7.4-${STABILITY} tagx && \
popd
# Build the php 7 builder image.
pushd php/builder7 && \
make VERSION=${VERSION} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=alpine-14 build && \
docker tag ${REGISTRY}/unified-builder:${VERSION}${EXTRAVERSION} ${REGISTRY}/unified-builder:7.4-${STABILITY} && \
popd
else
echo "Skipping PHP7 builds."
fi
if [ ${EIGHT} -eq 1 ]; then
# First off, we build the base php 8 image.
pushd php/base/php8 && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE8} buildx && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.0-${STABILITY} tagx && \
popd
# Build the standard php 8 image.
pushd php/php8 && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION8}${EXTRAVERSION} buildx && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.0-${STABILITY} tagx && \
popd
# Build the k8s php 8 image.
pushd php/php-k8s-v8 && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION8}${EXTRAVERSION} buildx && \
make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.0-${STABILITY} tagx && \
popd
# Build the php 8 builder image.
# pushd php/builder8 && \
# make VERSION=${VERSION8} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=16.19.0-alpine3.16 build && \
# docker tag ${REGISTRY}/unified-builder:${VERSION8}${EXTRAVERSION} ${REGISTRY}/unified-builder:8.0-${STABILITY} && \
# popd
BASE=${SAVEBASE}
else
echo "Skipping PHP8 builds."
fi
if [ ${EIGHTONE} -eq 1 ]; then
# First off, we build the base php 8.1 image.
pushd php/base/php81 && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE81} buildx && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.1-${STABILITY} tagx && \
popd
# Build the standard php 8.1 image.
pushd php/php81 && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION81}${EXTRAVERSION} buildx && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.1-${STABILITY} tagx && \
popd
# Build the k8s php 81 image.
pushd php/php-k8s-v81 && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION81}${EXTRAVERSION} buildx && \
make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.1-${STABILITY} tagx && \
popd
# Build the php 8.1 builder image.
# pushd php/builder81 && \
# make VERSION=${VERSION81} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=16.19.0-alpine build && \
# docker tag ${REGISTRY}/unified-builder:${VERSION81}${EXTRAVERSION} ${REGISTRY}/unified-builder:8.1-${STABILITY} && \
# popd
else
echo "Skipping PHP8.1 builds."
fi
if [ ${EIGHTTWO} -eq 1 ]; then
# First off, we build the base php 8.2 image.
pushd php/base/php82 && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE82} buildx && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.2-${STABILITY} tagx && \
popd
# Build the standard php 8.2 image.
pushd php/php82 && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION82}${EXTRAVERSION} buildx && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.2-${STABILITY} tagx && \
popd
# Build the k8s php 82 image.
pushd php/php-k8s-v82 && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION82}${EXTRAVERSION} buildx && \
make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.2-${STABILITY} tagx && \
popd
# Since sass is not needed, node is not needed, which means builder is not needed.
# Build the php 8.2 builder image.
# pushd php/builder82 && \
# make VERSION=${VERSION82} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=16-alpine build && \
# docker tag ${REGISTRY}/unified-builder:${VERSION82}${EXTRAVERSION} ${REGISTRY}/unified-builder:8.2-${STABILITY} && \
# popd
else
echo "Skipping PHP8.2 builds."
fi
if [ ${EIGHTTHREE} -eq 1 ]; then
# First off, we build the base php 8.3 image.
pushd php/base/php83 && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE83} buildx && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.3-${STABILITY} tagx && \
popd
# Build the standard php 8.3 image.
pushd php/php83 && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION83}${EXTRAVERSION} buildx && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.3-${STABILITY} tagx && \
popd
# Build the k8s php 83 image.
pushd php/php-k8s-v83 && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION83}${EXTRAVERSION} buildx && \
make VERSION=${VERSION83} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.3-${STABILITY} tagx && \
popd
else
echo "Skipping PHP8.3 builds."
fi
if [ ${EIGHTFOUR} -eq 1 ]; then
# Yeeeeeaaaaaah
STABILITY=unstable
# First off, we build the base php 8.4 image.
pushd php/base/php84 && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${BASE84} buildx && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.4-${STABILITY} tagx && \
popd
# Build the standard php 8.4 image.
pushd php/php84 && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION84}${EXTRAVERSION} buildx && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.4-${STABILITY} tagx && \
popd
# Build the k8s php 84 image.
pushd php/php-k8s-v84 && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} UPSTREAM=${VERSION84}${EXTRAVERSION} buildx && \
make VERSION=${VERSION84} EXTRAVERSION=${EXTRAVERSION} MANIFEST_VERSION=8.4-${STABILITY} tagx && \
popd
else
echo "Skipping PHP8.4 builds."
fi
# Login, so we can push.
# aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/unocha