-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathsave-manifest-assets.sh
executable file
·577 lines (494 loc) · 20.3 KB
/
save-manifest-assets.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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
#!/bin/bash
set -e
PACKAGE_NAME=$1
MANIFEST_PATH=$2
OUT_DIR=$3
if ! test -f "$MANIFEST_PATH"; then
echo "$MANIFEST_PATH does not exist"
exit 1
fi
mkdir -p "$OUT_DIR"
function build_rhel_7() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-7"
mkdir -p "$outdir"
docker rm -f "rhel-7-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-7-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum-config-manager --disable main --disable base --disable extras --disable updates && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/ && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/extras/x86_64/ && \
curl https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 > vault.gpg.key && \
rpm --import vault.gpg.key
yum update -y ca-certificates && \
yum install -y epel-release && \
mkdir -p /packages/archives && \
yumdownloader --installroot=/tmp/empty-directory --releasever=/ --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "rhel-7-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function build_rhel_7_force() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-7-force"
mkdir -p "$outdir"
docker rm -f "rhel-7-force-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-7-force-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum-config-manager --disable main --disable base --disable extras --disable updates && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/ && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/extras/x86_64/ && \
curl https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 > vault.gpg.key && \
rpm --import vault.gpg.key
yum update -y ca-certificates && \
yum install -y epel-release && \
mkdir -p /packages/archives && \
yumdownloader --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "rhel-7-force-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function createrepo_rhel_7() {
local outdir=
outdir="$(realpath "$OUT_DIR")/rhel-7"
docker rm -f "rhel-7-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-7-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum-config-manager --disable main --disable base --disable extras --disable updates && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/ && \
curl https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 > vault.gpg.key && \
rpm --import vault.gpg.key
yum install -y createrepo && \
createrepo /packages/archives"
sudo docker cp "rhel-7-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function build_rhel_8() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-8"
mkdir -p "$outdir"
docker rm -f "rhel-8-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-8-$PACKAGE_NAME" \
rockylinux:8.5 \
/bin/bash -c "\
set -x
echo -e \"fastestmirror=1\nmax_parallel_downloads=8\" >> /etc/dnf/dnf.conf && \
yum install -y yum-utils epel-release && \
mkdir -p /packages/archives && \
yumdownloader --installroot=/tmp/empty-directory --releasever=/ --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "rhel-8-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function createrepo_rhel_8() {
local outdir=
outdir="$(realpath "$OUT_DIR")/rhel-8"
docker rm -f "rhel-8-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-8-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
rockylinux:8.5 \
/bin/bash -c "\
set -x
echo -e \"fastestmirror=1\nmax_parallel_downloads=8\" >> /etc/dnf/dnf.conf && \
yum install -y yum-utils createrepo && \
yum install -y modulemd-tools && \
createrepo_c /packages/archives && \
repo2module --module-name=kurl.local --module-stream=stable /packages/archives /tmp/modules.yaml && \
modifyrepo_c --mdtype=modules /tmp/modules.yaml /packages/archives/repodata"
sudo docker cp "rhel-8-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function image_name_suffix() {
echo "$PACKAGE_NAME" | tr '[:upper:]' '[:lower:]'
}
function build_image_rhel_9() {
local packages=("$@")
docker build -t "rhel-9-$(image_name_suffix)" -f bin/containertools/Dockerfile.rhel9 --build-arg PACKAGES="${packages[*]}" ./bin
}
function build_image_amazon_2023() {
local packages=("$@")
docker build -t "amazon-2023-$(image_name_suffix)" -f bin/containertools/Dockerfile.amazon2023 --build-arg PACKAGES="${packages[*]}" ./bin
}
function build_rhel_9() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-9"
mkdir -p "$outdir"
docker rm -f "rhel-9-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-9-$PACKAGE_NAME" \
-v "$PWD/bin/containertools":/opt/containertools \
"rhel-9-$(image_name_suffix)" \
bash /opt/containertools/yumdownloader.sh "${packages[*]}"
sudo docker cp "rhel-9-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function build_amazon_2023() {
local packages=("$@")
local outdir="$OUT_DIR/amazon-2023"
mkdir -p "$outdir"
docker rm -f "amazon-2023-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "amazon-2023-$PACKAGE_NAME" \
-v "$PWD/bin/containertools":/opt/containertools \
"amazon-2023-$(image_name_suffix)" \
bash /opt/containertools/yumdownloader.sh "${packages[*]}"
sudo docker cp "amazon-2023-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function createrepo_rhel_9() {
local outdir=
outdir="$(realpath "$OUT_DIR")/rhel-9"
docker rm -f "rhel-9-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-9-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"rhel-9-$(image_name_suffix)" \
/opt/containertools/createrepo.sh
sudo docker cp "rhel-9-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function createrepo_amazon_2023() {
local outdir=
outdir="$(realpath "$OUT_DIR")/amazon-2023"
docker rm -f "amazon-2023-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "amazon-2023-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"amazon-2023-$(image_name_suffix)" \
/opt/containertools/createrepo.sh
sudo docker cp "amazon-2023-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function build_deps_amazon_2023() {
local packages=("$@")
local outdir=
outdir="$(realpath "$OUT_DIR")/amazon-2023"
mkdir -p "$outdir"
# yum
for pkg in "${pkgs_amazon2023[@]}"; do
# remove yum9 packages
packages=( "${packages[@]/*${pkg}*}" )
done
if [ "${#packages[@]}" -gt 0 ]; then
printf '%s\n' "${packages[@]}" >> "$outdir/Deps"
fi
# yum9
if [ -f "$outdir/archives/repodata/repomd.xml" ]; then
docker rm -f "amazon-2023-subdeps-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "amazon-2023-subdeps-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"amazon-2023-$(image_name_suffix)" \
/opt/containertools/builddeps.sh \
>> "$outdir/Deps"
fi
# dockerout
if [ -f "$outdir/repodata/repomd.xml" ]; then
docker rm -f "amazon-2023-subdeps-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "amazon-2023-subdeps-$PACKAGE_NAME" \
-v "$outdir":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"amazon-2023-$(image_name_suffix)" \
/opt/containertools/builddeps.sh \
>> "$outdir/Deps"
fi
if [ ! -f "$outdir/Deps" ]; then
rm -rf "$outdir"
return
fi
sort "$OUT_DIR/amazon-2023/Deps" | uniq | grep -v '^[[:space:]]*$' > "$OUT_DIR/amazon-2023/Deps.tmp" # remove duplicates and empty lines
mv "$OUT_DIR/amazon-2023/Deps.tmp" "$OUT_DIR/amazon-2023/Deps"
}
function build_deps_rhel_9() {
local packages=("$@")
local outdir=
outdir="$(realpath "$OUT_DIR")/rhel-9"
mkdir -p "$outdir"
# yum
for pkg in "${pkgs_rhel9[@]}"; do
# remove yum9 packages
packages=( "${packages[@]/*${pkg}*}" )
done
if [ "${#packages[@]}" -gt 0 ]; then
printf '%s\n' "${packages[@]}" >> "$outdir/Deps"
fi
# yum9
if [ -f "$outdir/archives/repodata/repomd.xml" ]; then
docker rm -f "rhel-9-subdeps-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-9-subdeps-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"rhel-9-$(image_name_suffix)" \
/opt/containertools/builddeps.sh \
>> "$outdir/Deps"
fi
# dockerout
if [ -f "$outdir/repodata/repomd.xml" ]; then
docker rm -f "rhel-9-subdeps-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-9-subdeps-$PACKAGE_NAME" \
-v "$outdir":/packages/archives \
-v "$PWD/bin/containertools":/opt/containertools \
"rhel-9-$(image_name_suffix)" \
/opt/containertools/builddeps.sh \
>> "$outdir/Deps"
fi
if [ ! -f "$outdir/Deps" ]; then
rm -rf "$outdir"
return
fi
sort "$OUT_DIR/rhel-9/Deps" | uniq | grep -v '^[[:space:]]*$' > "$OUT_DIR/rhel-9/Deps.tmp" # remove duplicates and empty lines
mv "$OUT_DIR/rhel-9/Deps.tmp" "$OUT_DIR/rhel-9/Deps"
}
function build_ol_7() {
local packages=("$@")
local outdir="$OUT_DIR/ol-7"
mkdir -p "$outdir"
docker rm -f "ol-7-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "ol-7-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x && \
yum-config-manager --disable main --disable base --disable extras --disable updates && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/ && \
curl https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 > vault.gpg.key && \
rpm --import vault.gpg.key && \
yum-config-manager --add-repo=http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/ && \
mkdir -p /packages/archives && \
yumdownloader --disablerepo=* --enablerepo=public-yum.oracle.com_repo_OracleLinux_OL7_latest_x86_64_ --installroot=/tmp/empty-directory --releasever=/ --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "ol-7-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function createrepo_ol_7() {
local outdir=
outdir="$(realpath "$OUT_DIR")/ol-7"
docker rm -f "ol-7-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "ol-7-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum-config-manager --disable main --disable base --disable extras --disable updates && \
yum-config-manager --add-repo https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/ && \
curl https://archive.kernel.org/centos-vault/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 > vault.gpg.key && \
rpm --import vault.gpg.key
yum install -y createrepo && \
createrepo /packages/archives"
sudo docker cp "ol-7-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}
function try_5_times() {
local fn="$1"
local args=("${@:2}")
n=0
while ! $fn "${args[@]}" ; do
n="$(( n + 1 ))"
if [ "$n" = "5" ]; then
return 1
fi
sleep 2
done
}
pkgs_rhel7=()
pkgs_rhel8=()
pkgs_rhel9=()
pkgs_ol7=()
pkgs_amazon2023=()
deps_rhel9=()
deps_amazon2023=()
while read -r line || [ -n "$line" ]; do
if [ -z "$line" ]; then
continue
fi
# support for comments in manifest files
if [ "$(echo "$line" | cut -c1-1)" = "#" ]; then
continue
fi
kind=$(echo "$line" | awk '{ print $1 }')
echo "LINE $line"
case "$kind" in
image)
mkdir -p "$OUT_DIR/images"
filename=$(echo "$line" | awk '{ print $2 }')
image=$(echo "$line" | awk '{ print $3 }')
# we support both remote images and tar archives
if echo "$image" | grep -q '\.tar$' ; then
gzip -c "$image" > "$OUT_DIR/images/$filename.tar.gz"
else
try_5_times docker pull "$image"
docker save "$image" | gzip > "$OUT_DIR/images/$filename.tar.gz"
fi
;;
asset)
mkdir -p "$OUT_DIR/assets"
filename=$(echo "$line" | awk '{ print $2 }')
asset=$(echo "$line" | awk '{ print $3 }')
# we support both http and local assets
if echo "$asset" | grep -q '^https://' ; then
curl -fL -o "$OUT_DIR/assets/$filename" "$asset"
else
if [[ "$asset" != /* ]]; then
# asset is relative to the manifest file
manifest_dir="$(dirname "$MANIFEST_PATH")"
asset="$(realpath "$manifest_dir/$asset")"
fi
cp "$asset" "$OUT_DIR/assets/$filename"
fi
;;
apt)
mkdir -p "$OUT_DIR"/ubuntu-24.04 "$OUT_DIR"/ubuntu-22.04 "$OUT_DIR"/ubuntu-20.04 "$OUT_DIR"/ubuntu-18.04 "$OUT_DIR"/ubuntu-16.04
package=$(echo "$line" | awk '{ print $2 }')
echo "$package" >> "$OUT_DIR"/ubuntu-24.04/Deps
docker rm -f ubuntu-2204-"$package" 2>/dev/null || true
docker run \
--name ubuntu-2204-"$package" \
ubuntu:22.04 \
/bin/bash -c "\
mkdir -p /packages/archives && \
apt update -y \
&& apt install -d --no-install-recommends -y $package \
-oDebug::NoLocking=1 -o=dir::cache=/packages/"
docker cp ubuntu-2204-"$package":/packages/archives "$OUT_DIR"/ubuntu-22.04
sudo chown -R $UID "$OUT_DIR"/ubuntu-22.04
docker rm -f ubuntu-2004-"$package" 2>/dev/null || true
docker run \
--name ubuntu-2004-"$package" \
ubuntu:20.04 \
/bin/bash -c "\
mkdir -p /packages/archives && \
apt update -y \
&& apt install -d --no-install-recommends -y $package \
-oDebug::NoLocking=1 -o=dir::cache=/packages/"
docker cp ubuntu-2004-"$package":/packages/archives "$OUT_DIR"/ubuntu-20.04
sudo chown -R $UID "$OUT_DIR"/ubuntu-20.04
docker rm -f ubuntu-1804-"$package" 2>/dev/null || true
docker run \
--name ubuntu-1804-"$package" \
ubuntu:18.04 \
/bin/bash -c "\
mkdir -p /packages/archives && \
apt update -y \
&& apt install -d --no-install-recommends -y $package \
-oDebug::NoLocking=1 -o=dir::cache=/packages/"
docker cp ubuntu-1804-"$package":/packages/archives "$OUT_DIR"/ubuntu-18.04
sudo chown -R $UID "$OUT_DIR"/ubuntu-18.04
docker rm -f ubuntu-1604-"$package" 2>/dev/null || true
docker run \
--name ubuntu-1604-"$package" \
ubuntu:16.04 \
/bin/bash -c "\
mkdir -p /packages/archives && \
apt update -y \
&& apt install -d --no-install-recommends -y $package \
-oDebug::NoLocking=1 -o=dir::cache=/packages/"
docker cp ubuntu-1604-"$package":/packages/archives "$OUT_DIR"/ubuntu-16.04
sudo chown -R $UID "$OUT_DIR"/ubuntu-16.04
;;
apt24)
mkdir -p "$OUT_DIR"/ubuntu-24.04
package=$(echo "$line" | awk '{ print $2 }')
echo "$package" >> "$OUT_DIR"/ubuntu-24.04/Deps
;;
yum)
package=$(echo "$line" | awk '{ print $2 }')
pkgs_rhel7+=("$package")
pkgs_rhel8+=("$package")
deps_rhel9+=("$package")
deps_amazon2023+=("$package")
;;
yum8)
package=$(echo "$line" | awk '{ print $2 }')
pkgs_rhel8+=("$package")
;;
yum9)
package=$(echo "$line" | awk '{ print $2 }')
pkgs_rhel9+=("$package")
;;
yumol)
package=$(echo "$line" | awk '{ print $2 }')
pkgs_ol7+=("$package")
;;
yum2023)
package=$(echo "$line" | awk '{ print $2 }')
pkgs_amazon2023+=("$package")
;;
dockerout)
dstdir=$(echo "$line" | awk '{ print $2 }')
dockerfile=$(echo "$line" | awk '{ print $3 }')
version=$(echo "$line" | awk '{ print $4 }')
outdir="$OUT_DIR/$dstdir"
name="dockerout-$PACKAGE_NAME-$dstdir"
mkdir -p "$outdir"
docker build --build-arg VERSION="$version" -t "$name" - < "$dockerfile"
docker run --rm -v "$outdir":/out "$name"
sudo chown -R $UID "$outdir"
;;
*)
echo "Unknown kind $kind in line: $line"
exit 1
;;
esac
done < "$MANIFEST_PATH"
build_image_amazon_2023 "${pkgs_amazon2023[@]}"
if [ "${#pkgs_amazon2023[@]}" -gt "0" ]; then
build_amazon_2023 "${pkgs_amazon2023[@]}"
fi
if [ "$(find "$OUT_DIR"/amazon-2023/archives/*.rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_amazon_2023
fi
build_deps_amazon_2023 "${deps_amazon2023[@]}"
if [ "${#pkgs_rhel7[@]}" -gt "0" ]; then
build_rhel_7 "${pkgs_rhel7[@]}"
fi
if [ "$(find "$OUT_DIR"/rhel-7/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_rhel_7
fi
if [ "${#pkgs_rhel7[@]}" -gt "0" ]; then
build_rhel_7_force "${pkgs_rhel7[@]}"
fi
if [ "${#pkgs_ol7[@]}" -gt "0" ]; then
build_ol_7 "${pkgs_ol7[@]}"
fi
if [ "$(find "$OUT_DIR"/ol-7/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_ol_7
fi
if [ "${#pkgs_rhel8[@]}" -gt "0" ]; then
build_rhel_8 "${pkgs_rhel8[@]}"
fi
if [ "$(find "$OUT_DIR"/rhel-8/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_rhel_8
fi
build_image_rhel_9 "${pkgs_rhel9[@]}"
if [ "${#pkgs_rhel9[@]}" -gt "0" ]; then
build_rhel_9 "${pkgs_rhel9[@]}"
fi
if [ "$(find "$OUT_DIR"/rhel-9/archives/*.rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_rhel_9
fi
build_deps_rhel_9 "${deps_rhel9[@]}"