Merge "Add centos7 support for DIB_DISTRIBUTION_MIRROR"

This commit is contained in:
Jenkins 2015-09-17 13:17:39 +00:00 committed by Gerrit Code Review
commit 69b8823b62
2 changed files with 23 additions and 0 deletions

View File

@ -4,3 +4,11 @@ centos7
Use Centos 7 cloud images as the baseline for built disk images.
For further details see the redhat-common README.
DIB_DISTRIBUTION_MIRROR:
:Required: No
: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 ``5/6/7`` directories.
:Example: ``DIB\_DISTRIBUTION\_MIRROR=http://amirror.com/centos``

View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
# Only set the mirror for the Base, Extras and Updates repositories
# The others arn't enabled and do not exist on all mirrors
sed -e "s|^#baseurl=http://mirror.centos.org/centos|baseurl=$DIB_DISTRIBUTION_MIRROR|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo