diff options
author | Thomas Haller <thaller@redhat.com> | 2022-02-21 15:20:09 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-02-21 17:03:36 +0100 |
commit | 613af3251b9817aa71dc586487756391fed99059 (patch) | |
tree | 001726388d500236fcb705ef65ee61e7efe3891b | |
parent | aaf952cbc459291f8161530b2bdf26eb5886d397 (diff) | |
download | NetworkManager-613af3251b9817aa71dc586487756391fed99059.tar.gz |
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/
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | .gitlab-ci/fedora-install.sh | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 51ce0dc604..971f33cb2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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' diff --git a/.gitlab-ci/fedora-install.sh b/.gitlab-ci/fedora-install.sh index eff9e52432..6a4b91bfe6 100755 --- a/.gitlab-ci/fedora-install.sh +++ b/.gitlab-ci/fedora-install.sh @@ -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 || \ |