diff options
author | Thomas Haller <thaller@redhat.com> | 2023-05-22 14:36:24 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-05-22 14:47:42 +0200 |
commit | 436b9cb0050731071a25751fbd019768829df169 (patch) | |
tree | 0a72cf0207c77f7d2553b2510a9f1dab7af07385 | |
parent | 1a0fa8539737c784f17a5639e67a87a8636aa23b (diff) |
gitlab-ci: improve "fedora-install.sh" for CentOS Stream
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | .gitlab-ci/fedora-install.sh | 38 |
2 files changed, 26 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a221f129e..69a4eb1b06 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,9 +57,9 @@ variables: # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". ALPINE_TAG: 'tag-8399f83819ed' - CENTOS_TAG: 'tag-a5e8e3d94c70' + CENTOS_TAG: 'tag-7405a4b74c04' DEBIAN_TAG: 'tag-f97319c5ab59' - FEDORA_TAG: 'tag-a5e8e3d94c70' + FEDORA_TAG: 'tag-7405a4b74c04' UBUNTU_TAG: 'tag-f97319c5ab59' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' diff --git a/.gitlab-ci/fedora-install.sh b/.gitlab-ci/fedora-install.sh index 575c65b743..95ceeb20ec 100755 --- a/.gitlab-ci/fedora-install.sh +++ b/.gitlab-ci/fedora-install.sh @@ -4,40 +4,50 @@ set -ex IS_FEDORA=0 IS_CENTOS=0 -IS_CENTOS_7=0 -IS_CENTOS_8=0 +CENTOS_VERSION=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 if grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ; then - IS_CENTOS_7=1 + CENTOS_VERSION=7 elif grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ; then - IS_CENTOS_8=1 + CENTOS_VERSION=8 + elif grep -q '^VERSION_ID=.*\<9\>' /etc/os-release ; then + CENTOS_VERSION=9 + else + exit 1 + fi + if grep -q "^NAME.*Stream" /etc/os-release ; then + CENTOS_VERSION="stream$CENTOS_VERSION" fi fi - if [ $IS_CENTOS = 1 ]; then - if [ $IS_CENTOS_7 = 1 ]; then + if [ "$IS_CENTOS" = 1 ]; then + if [ "$CENTOS_VERSION" = 7 ]; then yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install -y glibc-common localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 locale -a yum install -y python36-dbus python36-gobject-base - elif [ $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-* - + elif [ "$CENTOS_VERSION" = 8 -o "$CENTOS_VERSION" = stream8 ]; then + if [ "$CENTOS_VERSION" = 8 ]; 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 || \ dnf config-manager --set-enabled PowerTools curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-8/nmstate-nm-build-deps-epel-8.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-8.repo - else - dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm + elif [ "$CENTOS_VERSION" = stream9 ]; then + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm dnf install -y 'dnf-command(config-manager)' + dnf config-manager --set-enabled crb curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-9/nmstate-nm-build-deps-epel-9.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-9.repo + else + exit 1 fi fi |