Merge "Download latest CentOS cloud image"

This commit is contained in:
Zuul 2020-07-05 21:06:43 +00:00 committed by Gerrit Code Review
commit 5d16300f00

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" | head -1)
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)
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$LATEST_IMAGE_FILE}
fi
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz