Merge "Add support for CentOS 8 Stream cloud image"

This commit is contained in:
Zuul 2020-09-24 14:55:23 +00:00 committed by Gerrit Code Review
commit cbeca0babd
10 changed files with 27 additions and 6 deletions

View File

@ -43,6 +43,7 @@
dib_functests:
- centos7/build-succeeds
- centos/8-build-succeeds
- centos/8-stream-build-succeeds
- fedora/build-succeeds
- opensuse/build-succeeds
- opensuse/opensuse15-build-succeeds

View File

@ -14,7 +14,7 @@ DIB_DISTRIBUTION_MIRROR:
:Default: None
:Description: To use a CentOS Yum mirror, set this variable to the mirror URL
before running bin/disk-image-create. This URL should point to
the directory containing the ``7/8`` directories.
the directory containing the ``7/8/8-stream`` directories.
:Example: ``DIB_DISTRIBUTION_MIRROR=http://amirror.com/centos``
DIB_CLOUD_IMAGES:

View File

@ -1,7 +1,7 @@
# since CentOS 8, dnf is the yum replacement.
if [[ ${DIB_RELEASE} == '8' ]]; then
export YUM=dnf
elif [[ ${DIB_RELEASE} == '7' ]]; then
if [[ $DIB_RELEASE == "7" ]]; then
export YUM=yum
else
export YUM=dnf
fi

View File

@ -14,10 +14,19 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
# The others aren't enabled and do not exist on all mirrors
if [[ ${DIB_RELEASE} == '7' ]]; then
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\(centos\|altarch\)/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo
elif [[ ${DIB_RELEASE} == '8' ]]; then
elif [[ ${DIB_RELEASE} > '7' ]]; then
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-AppStream.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-centosplus.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Extras.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-PowerTools.repo
fi
# CentOS Stream releases (e.g. 8-stream, 9-stream)
if [[ ${DIB_RELEASE} =~ '-stream' ]]; then
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-Base.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-AppStream.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-centosplus.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-Extras.repo
sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
fi

View File

@ -51,7 +51,7 @@ else
if [[ "${DIB_RELEASE}" = 7 ]]; then
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-${DIB_RELEASE}-${ARCH}-${DIB_FLAVOR}.qcow2.xz}
else
LATEST_IMAGE_FILE=$(curl -s https://cloud.centos.org/centos/${DIB_RELEASE}/${ARCH}/images/ | grep -o "CentOS-${DIB_RELEASE}-${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r | head -1)
LATEST_IMAGE_FILE=$(curl -s https://cloud.centos.org/centos/${DIB_RELEASE}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r | head -1)
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$LATEST_IMAGE_FILE}
fi
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz

View File

@ -0,0 +1 @@
Centos Stream 8 test

View File

@ -0,0 +1,3 @@
base
epel
openstack-ci-mirrors

View File

@ -0,0 +1 @@
export DIB_RELEASE='8-stream'

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``centos`` element supports CentOS 8 Stream builds when run with
``DIB_RELEASE=8-stream``