-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap.sh
516 lines (452 loc) · 17.8 KB
/
bootstrap.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
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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
#!/bin/bash
#
# Univention Container Mode - bootstrap script
#
# Copyright 2020-2021 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <http://www.gnu.org/licenses/>.
# ToDo
# - Fix --platform for multi-platform server on import
# - switch to GitHub API
# => curl --silent --header "Accept: application/vnd.github.v3+json" https://api.github.com/repos/univention/univention-corporate-server/tags | jq -r .[].name
# => curl --silent --header "Accept: application/vnd.github.v3+json" https://api.github.com/repos/univention/univention-corporate-server/tags | jq -r .[0].name | tr --complement --delete '[:digit:]'
# - Fix missing usr-is-merged
# => I: Checking component main on https://updates.software-univention.de/...
# => E: Couldn't find these debs: usr-is-merged
# patch /usr/share/debootstrap/scripts/debian-common <<EOF
# @@ -48,7 +48,7 @@
# # we can install the empty 'usr-is-merged' metapackage to indicate
# # that the transition has been done.
# case "\$CODENAME" in
# - etch*|lenny|squeeze|wheezy|jessie*|stretch|buster|bullseye)
# + etch*|lenny|squeeze|wheezy|jessie*|stretch|buster|bullseye|ucs*)
# ;;
# *)
# required="\$required usr-is-merged"
# EOF
## CHECK FOR ROOT USER
[[ ${LOGNAME} == root ]] || {
echo -e "NOTE: root user is needed!\nUSE: $0 with sudo\n\tsudo /bin/bash $0 $@"
exit 1
}
## FUNCTION(S)
function getPath() {
echo "$(which ${1} 2>/dev/null | awk '/^\/.*'${1}'$/ {printf "%s", $0}' | head -n 1)"
}
function missing() {
echo -e "ERROR: missing ${1} ... fix this by install!"
which apt >/dev/null 2>&1 &&
echo -e "INSTALL:\n\tapt install ${1}"
which yum >/dev/null 2>&1 &&
echo -e "INSTALL:\n\tyum install ${1}"
exit 1
}
function keyrings() {
find /usr/share/${1} -type f -exec cat {} \; |
awk '/^keyring.*\.gpg$/{ print $2 }' | sort | uniq |
awk '!/tanglu-archive-keyring.gpg/{ print "test -f " $1 " || echo \"INFO: KEYRING(" $0 ") NOT FOUD ON SYSTEM ...\" "}' |
bash -
}
## SET DOCKER OR PODMAN PATH
docker=$(which docker podman 2>/dev/null | awk '/^\/.*(docker|podman)$/{printf "%s", $0}' | head -n 1 || /bin/true)
[[ -z ${docker} ]] && {
echo -e "ERROR: missing docker or podman ... fix this by install!"
echo -e "INFO:\n\thttps://docs.docker.com/engine/install/\n\thttps://podman.io/getting-started/installation.html"
exit 1
}
## SET ARCH ( OR ARCH-TEST PATH )
arch=$(getPath arch-test)
[[ -z ${arch} ]] &&
arch=$(uname --machine | awk '/^i(3|4|5|6)86$/{ print "i386" } /^x86_64$/{ print "amd64" }')
## SET CURL PATH
curl=$(getPath curl)
[[ -z ${curl} ]] &&
missing curl
## SET CURL DEFAULT OPTION(S)
[[ -z ${curl} ]] ||
curl="${curl} --fail --silent"
## SET DPKG PATH
dpkg=$(getPath dpkg)
[[ -z ${dpkg} ]] &&
missing dpkg
## SET GPG PATH
gpg=$(getPath gpg)
[[ -z ${gpg} ]] &&
missing gpg
## SET GPG DEFAULT OPTION(S)
[[ -z ${gpg} ]] ||
gpg="${gpg} --batch --no-default-keyring"
## SET JQ PATH
jq=$(getPath jq)
[[ -z ${jq} ]] &&
missing jq
## SET JQ DEFAULT OPTION(S)
[[ -z ${jq} ]] ||
jq="${jq} --raw-output"
## GET PLATFORM FROM KERNEL
PLATFORM=$(uname --kernel-name | awk '{print tolower($0)}')
## CHECK JSON CONFIG FILE
[[ -f $0.json ]] || {
echo "JSON CONFIG FILE($0.json) MISSING ..."
exit 1
}
## SET JSON CONFIG FILE
JSON=$0.json
## SET BASH DEFAULT VALUE(S)
ARTIFACTS=FALSE
DRY_RUN=FALSE
CACHING=FALSE
SLIMIFY=FALSE
## CHECK OPTION(S)
[[ ${#@} == 0 ]] && {
echo "USE: /bin/bash $0 --help"
exit 1
}
## SET OPTION(S)
while (("${#@}")); do
case ${1} in
--get-artifacts) {
ARTIFACTS=TRUE
} ;;
--all-distributions) {
shift
} ;;
--distribution) {
shift && {
for strap in debootstrap febootstrap; do
[[ $(${jq} .${PLATFORM}.${strap}.dir ${JSON}) == null ]] || {
bootstrap=$(getPath ${strap}) # SET (D|F)EBOOTSTRAP PATH
[[ -z ${bootstrap} ]] && missing ${strap} && keyrings ${strap} || {
for distribution in $(${jq} .${PLATFORM}.${strap}.distributions[].name ${JSON}); do
[[ "${1}" == "${distribution}" ]] && DistName="${1}"
done
}
}
done
[[ -z ${DistName} ]] && {
echo -e \
"ERROR: --distribution ${1} not found\
\n\tTRY /bin/bash ${0} --list-distribution\
\n\t OR /bin/bash ${0} --all-distribution"
exit 1
}
}
} ;;
--list-distributions) {
for strap in debootstrap febootstrap; do
[[ $(${jq} .${PLATFORM}.${strap}.dir ${JSON}) == null ]] || {
bootstrap=$(getPath ${strap}) # SET (D|F)EBOOTSTRAP PATH
[[ -z ${bootstrap} ]] && missing ${strap} && keyrings ${strap} || {
for distribution in $(${jq} .${PLATFORM}.${strap}.distributions[].name ${JSON}); do
echo -e \
"distribution: $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".url.distribution ${JSON})\
\n\t/bin/bash $0 --distribution ${distribution}"
done
}
}
done
exit 0
} ;;
--all-codenames) {
shift
} ;;
--codename) {
shift && {
for strap in debootstrap febootstrap; do
[[ $(${jq} .${PLATFORM}.${strap}.dir ${JSON}) == null ]] || {
bootstrap=$(getPath ${strap}) # SET (D|F)EBOOTSTRAP PATH
[[ -z ${bootstrap} ]] && missing ${strap} && keyrings ${strap} || {
for distribution in $(${jq} .${PLATFORM}.${strap}.distributions[].name ${JSON}); do
for codename in $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames[].name ${JSON}); do
[[ "${1}" == "${codename}" ]] && CodeName="${1}"
done
done
}
}
done
[[ -z ${CodeName} ]] && {
echo -e \
"ERROR: --codename ${1} not found\
\n\tTRY /bin/bash ${0} --list-codenames\
\n\t OR /bin/bash ${0} --all-codenames"
exit 1
}
}
} ;;
--list-codenames) {
for strap in debootstrap febootstrap; do
[[ $(${jq} .${PLATFORM}.${strap}.dir ${JSON}) == null ]] || {
bootstrap=$(getPath ${strap}) # SET (D|F)EBOOTSTRAP PATH
[[ -z ${bootstrap} ]] && missing ${strap} && keyrings ${strap} || {
for distribution in $(${jq} .${PLATFORM}.${strap}.distributions[].name ${JSON}); do
for codename in $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames[].name ${JSON}); do
echo -e \
"\t/bin/bash $0 --distribution ${distribution} --codename ${codename}"
done
done
}
}
done
exit 0
} ;;
--arch) {
shift && {
[[ -f ${arch} ]] || {
echo \
${arch} | egrep --quiet "^${1}$" && arch=${1} || /bin/true
}
[[ -f ${arch} ]] && {
test -x \
${arch} &&
${arch} | egrep --quiet "^${1}$" && arch=${1} || /bin/true
}
}
} ;;
--use-cache) {
CACHING=TRUE
} ;;
--slimify) {
SLIMIFY=TRUE
} ;;
--dry-run) {
DRY_RUN=TRUE
} ;;
--debug) {
DEBUG=TRUE
} ;;
--help | *) {
echo "USE: /bin/bash $0 --help"
echo ""
echo "ARG: /bin/bash $0 --all-distributions [--arch <arch> [--use-cache [ --get-artifacts [ --dry-run [--debug]]]]]]"
echo ""
echo "ARG: /bin/bash $0 --distribution <distribution> [ --codename <codename> [--arch <arch> [--use-cache [ --get-artifacts [ --dry-run [--debug]]]]]]]"
echo ""
echo "ARG: /bin/bash $0 --list-distributions"
echo "ARG: /bin/bash $0 --list-codenames"
echo ""
echo "ARG: /bin/bash $0 --get-artifacts"
echo ""
echo "ARG: /bin/bash $0 --use-cache"
echo ""
echo "ARG: /bin/bash $0 --slimify"
echo ""
echo "ARG: /bin/bash $0 --dry-run"
echo "ARG: /bin/bash $0 --debug"
exit 0
} ;;
esac
shift
done
[[ ${DEBUG:-} =~ ^1|yes|true|YES|TRUE$ ]] && {
set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
}
[[ ${SLIMIFY:-} =~ ^1|yes|true|YES|TRUE$ ]] && SLIM="-slim" || SLIM=""
for strap in debootstrap febootstrap; do
[[ $(${jq} .${PLATFORM}.${strap}.dir ${JSON}) == null ]] || {
bootstrap=$(getPath ${strap}) # SET (D|F)EBOOTSTRAP PATH
[[ -z ${bootstrap} ]] && missing ${strap} && keyrings ${strap} || {
DIR=$(${jq} .${PLATFORM}.${strap}.dir ${JSON})/${PLATFORM}
for distribution in $(${jq} .${PLATFORM}.${strap}.distributions[].name ${JSON}); do
[[ ${#DistName} != 0 ]] && [[ "${DistName}" != "${distribution}" ]] && continue
for codename in $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames[].name ${JSON}); do
[[ ${#CodeName} != 0 ]] && [[ "${CodeName}" != "${codename}" ]] && continue
OPTION=""
SUITE=${codename}
TARGET=""
MIRROR=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".mirror ${JSON})
SCRIPT=""
KEYRING=""
for option in $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".options[] ${JSON}); do
OPTION="${OPTION} --${option}"
done
INCLUDE=""
EXCLUDE=""
for package in \
$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".packages.include[] ${JSON}) \
$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".packages.default[] ${JSON}); do
INCLUDE="${INCLUDE},${package}"
done
for package in \
$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".packages.exclude[] ${JSON}); do
EXCLUDE="${EXCLUDE},${package}"
done
[[ -z ${INCLUDE} ]] || INCLUDE=$(echo ${INCLUDE} | sed 's/^,/ --include /g')
[[ -z ${EXCLUDE} ]] || EXCLUDE=$(echo ${EXCLUDE} | sed 's/^,/ --exclude /g')
OPTION="${OPTION}${INCLUDE}${EXCLUDE}"
VARIANT=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".packages.variant ${JSON} | awk '!/null/{ print " --variant " $0 }')
OPTION="${OPTION}${VARIANT}"
case ${distribution} in
univention-corporate-server*) {
[[ $(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".gpg.key.hash ${JSON}) == null ]] || {
HASH=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".gpg.key.hash ${JSON})
FILE=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".gpg.key.file ${JSON})
HTTP=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".gpg.key.http ${JSON})
case ${codename} in
*) SCRIPT=/usr/share/debootstrap/scripts/stable ;;
esac
MAJOR=$(echo ${codename} | tr --complement --delete '[:digit:]' | awk NF=NF FS= | awk '{ print $1 }')
MINOR=$(echo ${codename} | tr --complement --delete '[:digit:]' | awk NF=NF FS= | awk '{ print $2 }')
PATCH=$(echo ${codename} | tr --complement --delete '[:digit:]' | awk NF=NF FS= | awk '{ print $3 }')
VERSION=${MAJOR}.${MINOR}-${PATCH}
KEYRING="${DIR}/${distribution}/${HASH}.gpg"
mkdir --parents $(dirname ${KEYRING}) && {
[[ -f ${FILE} ]] && KEYRING=${FILE}
[[ -f ${FILE} ]] || {
CURL="${curl} --location ${HTTP} --output ${KEYRING}"
GPG="${CURL} || ${gpg} --keyring ${KEYRING} --recv-key ${HASH} > /dev/null 2>&1"
[[ ${DRY_RUN-} =~ ^1|yes|true|YES|TRUE$ ]] && echo ${GPG}
[[ ${DRY_RUN-} =~ ^1|yes|true|YES|TRUE$ ]] || echo ${GPG} | bash -
}
}
OPTION="${OPTION} --keyring ${KEYRING}"
[[ "${MAJOR}" -ge "5" ]] || MIRROR="${MIRROR}/${MAJOR}.${MINOR}/maintained/${MAJOR}.${MINOR}-${PATCH}"
}
} ;;
*) {
OPTION="${OPTION}"
} ;;
esac
BootStrapOptions="${OPTION}"
for ARCH in $(
test -x ${arch} && ${arch} || echo ${arch}
); do
${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".arch[] ${JSON} | egrep --quiet ${ARCH} ||
echo "INFO: Skipping non-supported architecture ${ARCH} ..."
${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".arch[] ${JSON} | egrep --quiet ${ARCH} && {
OPTION="${BootStrapOptions} --arch ${ARCH}"
CACHED=${DIR}/${distribution}/cached
TARGET=${DIR}/${distribution}/${ARCH}/${codename}
ARTIFACT=${DIR}/${distribution}.tar
[[ ${VERSION-} =~ ^$ ]] && VERSION=${codename}
[[ ${docker} =~ podman$ ]] &&
IMAGE=localhost/${distribution/-test/}-$(basename ${bootstrap}) || IMAGE=${distribution/-test/}-$(basename ${bootstrap})
TAG=$(${jq} .${PLATFORM}.${strap}.distributions."\"${distribution}\"".codenames."\"${codename}\"".tag ${JSON})
[[ ${TAG} =~ ^test$ ]] && VERSION=${VERSION}-${TAG}
[[ ${CACHING-} =~ ^1|yes|true|YES|TRUE$ ]] && {
${bootstrap} --help | egrep --quiet -- "--cache-dir" && {
mkdir --parents ${CACHED} && OPTION="${OPTION} --cache-dir ${CACHED}"
}
}
rm --recursive --force ${TARGET}
mkdir --parents ${TARGET} && {
BOOTSTRAP="${bootstrap} ${OPTION} ${SUITE} ${TARGET} ${MIRROR} ${SCRIPT}"
[[ ${DRY_RUN-} =~ ^1|yes|true|YES|TRUE$ ]] && echo ${BOOTSTRAP}
[[ ${DRY_RUN-} =~ ^1|yes|true|YES|TRUE$ ]] || echo ${BOOTSTRAP} | bash -
[[ ${DRY_RUN-} =~ ^1|yes|true|YES|TRUE$ ]] && {
echo ${docker} import --message "${BOOTSTRAP}" - ${IMAGE}:${VERSION}
}
[[ -d ${TARGET}/dev ]] && {
[[ -d ${TARGET}/var/lib/apt/lists ]] &&
rm --recursive --force \
${TARGET}/var/lib/apt/lists/*
[[ -d ${TARGET}/var/cache/apt ]] &&
rm --force \
${TARGET}/var/cache/apt/archives/*.deb \
${TARGET}/var/cache/apt/archives/partial/*.deb \
${TARGET}/var/cache/apt/*.bin
[[ -d ${TARGET}/var/cache/debconf ]] &&
rm --force \
${TARGET}/var/cache/debconf/*old
[[ -d ${TARGET}/var/log ]] &&
rm --force \
${TARGET}/var/log/*/* \
${TARGET}/var/log/* >/dev/null 2>&1 || /bin/true
[[ -d ${TARGET}/lib/modules ]] &&
rm --recursive --force \
${TARGET}/lib/modules/*
[[ -d ${TARGET}/boot ]] &&
rm --force \
${TARGET}/boot/* >/dev/null 2>&1 || /bin/true
for name in "initrd.img" "vmlinuz" "install"; do
find ${TARGET} -maxdepth 1 -type l -name "*${name}*" -exec rm --force {} \;
done
[[ ${SLIMIFY-} =~ ^1|yes|true|YES|TRUE$ ]] && {
find ${TARGET}/usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en*' \
-exec rm --recursive --force {} \;
echo -e "path-exclude /usr/share/locale/*\npath-include /usr/share/locale/en*" > \
${TARGET}/etc/dpkg/dpkg.cfg.d/univention-container-mode
echo -e "force-unsafe-io" > \
${TARGET}/etc/dpkg/dpkg.cfg.d/univention-container-mode-apt-speedup
rm --recursive --force \
${TARGET}/usr/share/groff \
${TARGET}/usr/share/info \
${TARGET}/usr/share/linda \
${TARGET}/usr/share/lintian \
${TARGET}/usr/share/man \
${TARGET}/var/cache/man || /bin/true
find ${TARGET}/usr/share/doc -depth -type f ! -name copyright \
-delete
find ${TARGET}/usr/share/doc -depth -empty \
-delete
find ${TARGET} -regex '^.*\(__pycache__\|\.py[co]\)$' \
-delete
}
i=0
${dpkg} --compare-versions ${MAJOR}.${MINOR}-${PATCH} ge 4.4-5 || while [ $((${MAJOR} + 1)) -gt ${i} ]; do
i=$((${i} + 1))
wget --quiet --directory-prefix=${TARGET}/etc/apt/trusted.gpg.d/ https://$(echo ${MIRROR} | awk -F/ '{print $3}')/univention-archive-key-ucs-${i}x.gpg && sleep 3 || continue
done
case ${SUITE} in
ucs5*) {
echo -e "deb [arch=${ARCH}] ${MIRROR} ${SUITE} main\ndeb [arch=${ARCH}] ${MIRROR} ${SUITE/ucs/errata} main" > \
${TARGET}/etc/apt/sources.list
} ;;
*) {
echo -e "deb [arch=${ARCH}] ${MIRROR} ${SUITE} main\ndeb [arch=${ARCH}] ${MIRROR/${MAJOR}.${MINOR}-${PATCH}/component} ${MAJOR}.${MINOR}-${PATCH}-errata/all/\ndeb [arch=${ARCH}] ${MIRROR/${MAJOR}.${MINOR}-${PATCH}/component} ${MAJOR}.${MINOR}-${PATCH}-errata/${ARCH}/" > \
${TARGET}/etc/apt/sources.list
} ;;
esac
tar --create --overwrite --directory=${TARGET} --file=${ARTIFACT} .
${docker} import --help | egrep --quiet -- "--platform" &&
${docker} import --message "${BOOTSTRAP}" --platform "${PLATFORM}/${ARCH}" ${ARTIFACT} ${IMAGE}:${VERSION}${SLIM} ||
${docker} import --message "${BOOTSTRAP}" ${ARTIFACT} ${IMAGE}:${VERSION}${SLIM}
[[ ${TAG} =~ ^latest|test$ ]] && {
${docker} image tag ${IMAGE}:${VERSION}${SLIM} ${IMAGE}:${TAG}${SLIM}
[[ ${docker} =~ podman$ ]] && {
echo
echo sudo ${docker} import --message \"${BOOTSTRAP}\" ${ARTIFACT} ${IMAGE}:${VERSION}${SLIM}
echo
echo sudo ${docker} image tag ${IMAGE}:${VERSION}${SLIM} ${IMAGE}:${TAG}${SLIM}
}
}
[[ ${ARTIFACTS-} =~ ^1|yes|true|YES|TRUE$ ]] && {
tar --create --overwrite --directory=${TARGET} --file=${ARTIFACT}.xz --xz .
tar --create --overwrite --directory=${TARGET} --file=${ARTIFACT}.gz --gzip .
echo && ls -lah ${ARTIFACT}*
}
}
}
}
done
done
done
}
}
done