-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
392 lines (365 loc) · 19.5 KB
/
.gitlab-ci.yml
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
image: docker:23.0.4
variables:
# DOCKER_HOST
# DOCKER_HUB_USERNAME
# DOCKER_HUB_PASSWORD
# GITLAB_TOKEN
DOCKER_HOST: $DOCKER_HOST
DOCKER_TLS_CERTDIR: ""
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_DRIVER: overlay2
DOCKER_IMAGE_TEST: registry.gitlab.com/maurosoft1973-docker/alpine-lftp:test
services:
- name: docker:23.0.4-dind
alias: docker
include:
- template: Jobs/Build.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml
stages:
- test
- scanning
- build
- readme
- clean
before_script:
- apk add --no-cache git bash curl file
- /bin/bash
- ENV_JOB=.${CI_ALPINE_VERSION:-""}
- |
if [ "${CI_ALPINE_VERSION:-""}" == "" ]; then
ENV_JOB=.env
else
ENV_JOB=.env.${CI_ALPINE_VERSION:-""}
fi
- set -a;
- source ./${ENV_JOB};
- set +a;
build:
stage: test
image: docker:23.0.4
tags:
- dind64
script:
- BUILD_DATE=$(date +"%Y-%m-%d")
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- |
while IFS=" " read -r JOB_ARCH
do
PLATFORM="linux/amd64"
if [ "${JOB_ARCH}" == "aarch64" ]; then
PLATFORM="linux/arm64"
elif [ "${JOB_ARCH}" == "armhf" ]; then
PLATFORM="linux/arm/v6"
elif [ "${JOB_ARCH}" == "armv7" ]; then
PLATFORM="linux/arm/v7"
elif [ "${JOB_ARCH}" == "ppc64le" ]; then
PLATFORM="linux/ppc64le"
elif [ "${JOB_ARCH}" == "x86" ]; then
PLATFORM="linux/386"
elif [ "${JOB_ARCH}" == "x86_64" ]; then
PLATFORM="linux/amd64"
fi
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_TEST == 1 ]; then
echo "Build Image for $JOB_ARCH -> TEST ($JOB_ALPINE_RELEASE,$JOB_LFTP_VERSION,$JOB_LFTP_VERSION_DATE)"
docker build --platform ${PLATFORM} \
--build-arg DOCKER_ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg BUILD_DATE=${BUILD_DATE} \
--build-arg ALPINE_ARCHITECTURE=${JOB_ARCH} \
--build-arg ALPINE_RELEASE=${JOB_ALPINE_RELEASE} \
--build-arg ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg ALPINE_VERSION_DATE="${JOB_ALPINE_VERSION_DATE}" \
--build-arg ALPINE_BRANCH=${JOB_ALPINE_RELEASE} \
--build-arg LFTP_VERSION="${JOB_LFTP_VERSION}" \
--build-arg LFTP_VERSION_DATE="${JOB_LFTP_VERSION_DATE}" \
--push \
-t ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_ARCH} \
-t ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-${JOB_ARCH} \
-f ./Dockerfile .
fi
done < "./.lftp_versions"
done < "./.arch"
- |
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_TEST == 1 ]; then
echo "Push Manifest Test -> ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test"
docker manifest create ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-aarch64 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-armhf \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-armv7 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-ppc64le \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-x86 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-x86_64
docker manifest push ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test
echo "Push Manifest Test -> ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}"
docker manifest create ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION} \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-aarch64 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-armhf \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-armv7 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-ppc64le \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-x86 \
--amend ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}-x86_64
docker manifest push ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE}:test-${JOB_LFTP_VERSION}
fi
done < "./.lftp_versions"
container_test:
stage: test
image: docker:23.0.4
allow_failure: true
needs: ["build"]
only:
- master
tags:
- dind64
script:
- apk add --no-cache curl
- |
curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64
chmod +x container-structure-test-linux-amd64
mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
- |
touch junit-test-result.xml
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_TEST == 1 ]; then
docker pull $DOCKER_IMAGE_TEST-${JOB_LFTP_VERSION}
if [[ -f "test.$JOB_LFTP_VERSION.yaml" ]]; then
container-structure-test -c test.$JOB_LFTP_VERSION.yaml --image $DOCKER_IMAGE_TEST-${JOB_LFTP_VERSION} --test-report junit-test-result.${JOB_LFTP_VERSION}.xml --output junit test
cat junit-test-result.${JOB_LFTP_VERSION}.xml >> junit-test-result.xml
else
container-structure-test -c test.yaml --image $DOCKER_IMAGE_TEST-${JOB_LFTP_VERSION} --test-report junit-test-result.${JOB_LFTP_VERSION}.xml --output junit test
cat junit-test-result.${JOB_LFTP_VERSION}.xml >> junit-test-result.xml
fi
fi
done < "./.lftp_versions"
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/junit-test-result.xml
reports:
junit:
- $CI_PROJECT_DIR/junit-test-result.xml
container_scanning:
stage: scanning
allow_failure: true
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
when: always
- when: never
needs: ["container_test"]
before_script: []
tags:
- dind64
variables:
CS_IMAGE: $DOCKER_IMAGE_TEST
build_current:
stage: build
image: docker:23.0.4
only:
- master
needs: ["build","container_test"]
tags:
- dind64
script:
- BUILD_DATE=$(date +"%Y-%m-%d")
- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
- |
while IFS=" " read -r JOB_ARCH
do
PLATFORM="linux/amd64"
if [ "${JOB_ARCH}" == "aarch64" ]; then
PLATFORM="linux/arm64"
elif [ "${JOB_ARCH}" == "armhf" ]; then
PLATFORM="linux/arm/v6"
elif [ "${JOB_ARCH}" == "armv7" ]; then
PLATFORM="linux/arm/v7"
elif [ "${JOB_ARCH}" == "ppc64le" ]; then
PLATFORM="linux/ppc64le"
elif [ "${JOB_ARCH}" == "x86" ]; then
PLATFORM="linux/386"
elif [ "${JOB_ARCH}" == "x86_64" ]; then
PLATFORM="linux/amd64"
fi
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
echo "Build Image for $JOB_ARCH -> CURRENT ($JOB_ALPINE_RELEASE,$JOB_LFTP_VERSION,$JOB_LFTP_VERSION_DATE)"
if [ $JOB_IMAGE_CURRENT == 1 ]; then
docker build --platform ${PLATFORM} \
--build-arg DOCKER_ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg BUILD_DATE=${BUILD_DATE} \
--build-arg ALPINE_ARCHITECTURE=${JOB_ARCH} \
--build-arg ALPINE_RELEASE=${JOB_ALPINE_RELEASE} \
--build-arg ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg ALPINE_VERSION_DATE="${JOB_ALPINE_VERSION_DATE}" \
--build-arg ALPINE_BRANCH=${JOB_ALPINE_RELEASE} \
--build-arg LFTP_VERSION="${JOB_LFTP_VERSION}" \
--build-arg LFTP_VERSION_DATE="${JOB_LFTP_VERSION_DATE}" \
--push \
-t ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ARCH} \
-t ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-${JOB_ARCH} \
-f ./Dockerfile .
fi
done < "./.lftp_versions"
done < "./.arch"
- |
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_CURRENT == 1 ]; then
echo "Push Manifest Current -> ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}"
docker manifest create ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION} \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-aarch64 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-armhf \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-armv7 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-ppc64le \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-x86 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-x86_64
docker manifest push ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}
echo "Push Manifest Current -> ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}"
docker manifest create ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION} \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-aarch64 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-armhf \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-armv7 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-ppc64le \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-x86 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}-x86_64
docker manifest push ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:${JOB_LFTP_VERSION}-${JOB_ALPINE_VERSION}
fi
done < "./.lftp_versions"
build_latest:
stage: build
image: docker:23.0.4
only:
- master
needs: ["build","container_test"]
tags:
- dind64
script:
- BUILD_DATE=$(date +"%Y-%m-%d")
- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
- |
while IFS=" " read -r JOB_ARCH
do
PLATFORM="linux/amd64"
if [ "${JOB_ARCH}" == "aarch64" ]; then
PLATFORM="linux/arm64"
elif [ "${JOB_ARCH}" == "armhf" ]; then
PLATFORM="linux/arm/v6"
elif [ "${JOB_ARCH}" == "armv7" ]; then
PLATFORM="linux/arm/v7"
elif [ "${JOB_ARCH}" == "ppc64le" ]; then
PLATFORM="linux/ppc64le"
elif [ "${JOB_ARCH}" == "x86" ]; then
PLATFORM="linux/386"
elif [ "${JOB_ARCH}" == "x86_64" ]; then
PLATFORM="linux/amd64"
fi
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
echo "Build Image for $JOB_ARCH -> LATEST ($JOB_ALPINE_RELEASE,$JOB_LFTP_VERSION,$JOB_LFTP_VERSION_DATE)"
if [ $JOB_IMAGE_LATEST == 1 ]; then
docker build --platform ${PLATFORM} \
--build-arg DOCKER_ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg BUILD_DATE=${BUILD_DATE} \
--build-arg ALPINE_ARCHITECTURE=${JOB_ARCH} \
--build-arg ALPINE_RELEASE=${JOB_ALPINE_RELEASE} \
--build-arg ALPINE_VERSION=${JOB_ALPINE_VERSION} \
--build-arg ALPINE_VERSION_DATE="${JOB_ALPINE_VERSION_DATE}" \
--build-arg ALPINE_BRANCH=${JOB_ALPINE_RELEASE} \
--build-arg LFTP_VERSION="${JOB_LFTP_VERSION}" \
--build-arg LFTP_VERSION_DATE="${JOB_LFTP_VERSION_DATE}" \
--push \
-t ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-${JOB_ARCH} \
-f ./Dockerfile .
fi
done < "./.lftp_versions"
echo "Build Image for $JOB_ARCH -> LATEST"
done < "./.arch"
- |
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_LATEST == 1 ]; then
echo "Push Manifest Latest -> ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest"
docker manifest create ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-aarch64 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-armhf \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-armv7 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-ppc64le \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-x86 \
--amend ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest-x86_64
docker manifest push ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE}:latest
fi
done < "./.lftp_versions"
readme:
stage: readme
image: docker:23.0.4
allow_failure: true
only:
- master
needs: ["build_latest"]
variables:
DOCKER_USER: $DOCKER_HUB_USERNAME
DOCKER_PASS: $DOCKER_HUB_PASSWORD
PUSHRM_SHORT: "LFTP Docker Image with Multilanguage e Timezone support running on Alpine Linux"
PUSHRM_TARGET: docker.io/$DOCKER_HUB_USERNAME/$DOCKER_HUB_IMAGE
PUSHRM_DEBUG: 1
PUSHRM_FILE: /tmp/repository/README.md
tags:
- dind64
script:
- FOUND=0
- |
while IFS="," read -r JOB_ALPINE_RELEASE JOB_ALPINE_VERSION JOB_ALPINE_VERSION_DATE JOB_IMAGE_TEST JOB_IMAGE_LATEST JOB_IMAGE_CURRENT JOB_LFTP_VERSION JOB_LFTP_VERSION_DATE
do
if [ $JOB_IMAGE_LATEST == 1 ]; then
ALPINE_RELEASE=${JOB_ALPINE_RELEASE}
ALPINE_VERSION=${JOB_ALPINE_VERSION}
ALPINE_VERSION_DATE=${JOB_ALPINE_VERSION_DATE}
LFTP_VERSION=${JOB_LFTP_VERSION}
LFTP_VERSION_DATE=${JOB_LFTP_VERSION_DATE}
FOUND=1
fi
done < "./.lftp_versions"
- |
if [ $FOUND == 0 ]; then
exit 0
fi
- export LAST_UPDATE=$(date +"%d.%m.%Y %H:%M:%S")
- |
git config --global user.email "[email protected]"
git config --global user.name "Mauro Cardillo"
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/$CI_PROJECT_PATH.git /tmp/repository
- cd /tmp/repository
- echo "Generate README for Alpine Version ${ALPINE_VERSION} and LFTP Version ${LFTP_VERSION}"
- |
sed "s/\%ALPINE_RELEASE\%/${ALPINE_RELEASE}/g" README.tpl > README_COMPILE.md1
sed "s/\%ALPINE_VERSION\%/${ALPINE_VERSION}/g" README_COMPILE.md1 > README_COMPILE.md2
sed "s/\%ALPINE_VERSION_DATE\%/${ALPINE_VERSION_DATE}/g" README_COMPILE.md2 > README_COMPILE.md3
sed "s/\%LFTP_VERSION\%/${LFTP_VERSION}/g" README_COMPILE.md3 > README_COMPILE.md4
sed "s/\%LFTP_VERSION_DATE\%/${LFTP_VERSION_DATE}/g" README_COMPILE.md4 > README_COMPILE.md5
sed "s/\%LAST_UPDATE\%/${LAST_UPDATE}/g" README_COMPILE.md5 > README.md
rm -rf README_COMPILE.*
- |
git add .
git commit -m "Update README for Alpine Version ${ALPINE_VERSION} and LFTP Version ${LFTP_VERSION}"
git push --push-option="ci.skip" https://gitlab-ci-token:${GITLAB_TOKEN}@${CI_SERVER_HOST}/$CI_PROJECT_PATH.git HEAD:$CI_COMMIT_BRANCH
- |
curl -LO https://github.com/christian-korneck/docker-pushrm/releases/download/v1.9.0/docker-pushrm_linux_amd64
chmod +x docker-pushrm_linux_amd64
mv docker-pushrm_linux_amd64 /usr/local/bin/docker-pushrm
- |
docker-pushrm docker.io/$DOCKER_HUB_USERNAME/$DOCKER_HUB_IMAGE
clean:
stage: clean
needs: ["build","build_current","build_latest"]
allow_failure: true
tags:
- dind64
only:
- master
script:
- |
docker images ${GITLAB_CR_URL}/${GITLAB_CR_GROUP}/${GITLAB_CR_IMAGE} -q | xargs --no-run-if-empty docker rmi -f
docker images ${DOCKER_HUB_GROUP}/${DOCKER_HUB_IMAGE} -q | xargs --no-run-if-empty docker rmi -f
docker volume ls -qf dangling=true | xargs --no-run-if-empty docker volume rm