gitlab-ci: fix CentOS Linux 8 containers during ".gitlab-ci/fedora-install.sh"

See-also: https://stackoverflow.com/questions/70926799/centos-through-vm-no-urls-in-mirrorlist
See-also: https://techglimpse.com/failed-metadata-repo-appstream-centos-8/
This commit is contained in:
Thomas Haller 2022-02-21 15:20:09 +01:00
parent aaf952cbc4
commit 613af3251b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 16 additions and 4 deletions

View file

@ -47,10 +47,10 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bump
# ".default_tag".
FEDORA_TAG: '2022-02-14.0-8384452eb54e'
FEDORA_TAG: '2022-02-14.0-4303738066bf'
UBUNTU_TAG: '2022-02-14.0-bd3c060f94c2'
DEBIAN_TAG: '2022-02-14.0-bd3c060f94c2'
CENTOS_TAG: '2022-02-14.0-8384452eb54e'
CENTOS_TAG: '2022-02-14.0-4303738066bf'
ALPINE_TAG: '2022-02-14.0-0990abecb69f'
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'

View file

@ -5,13 +5,18 @@ set -ex
IS_FEDORA=0
IS_CENTOS=0
IS_CENTOS_7=0
IS_CENTOS_8=0
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
if [ $IS_CENTOS = 1 ]; then
grep -q '^VERSION_ID=.*\<7\>' /etc/os-release && IS_CENTOS_7=1
if grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ; then
IS_CENTOS_7=1
elif grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ; then
IS_CENTOS_8=1
fi
fi
if [ $IS_CENTOS = 1 ]; then
if [ $IS_CENTOS = 1 ]; then
if [ $IS_CENTOS_7 = 1 ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y glibc-common
@ -19,6 +24,13 @@ if [ $IS_CENTOS = 1 ]; then
locale -a
yum install -y python36-dbus python36-gobject-base
else
if [ $IS_CENTOS_8 = 1 ]; then
# CentOS Linux 8 is now EOF and plain `dnf upgrade` does not work. We need
# to patch the mirror list.
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
fi
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools || \