Allow disto-specific mirror settings

Most of our distros support DIB_DISTRIBUTION_MIRROR for setting the
mirror to be used when building. This has a major downside where if
someone would like to create a static configuration for building various
distro images it cannot set DIB_DISTRIBUTION_MIRROR (think of the case
where we want to run our tests).

By adding support for DIB_$DISTRO_DISTRIBUTION_MIRROR this problem is
resolved.

Change-Id: I92964b17ec3e47cf97e3a3091f054b2a205ac768
This commit is contained in:
Gregory Haynes 2016-12-08 15:30:56 -08:00
parent 8c74c8e409
commit cd1965f7b7
6 changed files with 23 additions and 1 deletions

View File

@ -3,3 +3,7 @@ export DIB_RELEASE=${DIB_RELEASE:-GenericCloud}
# Useful for elements that work with fedora (dnf) & centos
export YUM=${YUM:-yum}
if [ -n "${DIB_CENTOS_DISTRIBUTION_MIRROR:-}" ]; then
export DIB_DISTRIBUTION_MIRROR=$DIB_CENTOS_DISTRIBUTION_MIRROR
fi

View File

@ -6,10 +6,12 @@ fi
set -eu
set -o pipefail
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://mirror.centos.org/centos}
cat << EOF > /etc/yum.repos.d/centos6-latest.repo
[rhel6]
name=centos6
baseurl=http://mirror.centos.org/centos/6/os/x86_64/
baseurl=$DIB_DISTRIBUTION_MIRROR/6/os/x86_64/
enabled=1
metadata_expire=7d
gpgcheck=0

View File

@ -3,3 +3,7 @@ export DIB_RELEASE=GenericCloud
# Useful for elements that work with fedora (dnf) & centos
export YUM=${YUM:-yum}
if [ -n "${DIB_CENTOS_DISTRIBUTION_MIRROR:-}" ]; then
export DIB_DISTRIBUTION_MIRROR=$DIB_CENTOS_DISTRIBUTION_MIRROR
fi

View File

@ -1,6 +1,11 @@
export DISTRO_NAME=debian
export DIB_RELEASE=${DIB_RELEASE:-stable}
if [ -n "${DIB_DEBIAN_DISTRIBUTION_MIRROR:-}" ]; then
DIB_DISTRIBUTION_MIRROR=$DIB_DEBIAN_DISTRIBUTION_MIRROR
fi
export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://ftp.us.debian.org/debian}
export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main}
export DIB_DEBIAN_COMPONENTS_WS=${DIB_DEBIAN_COMPONENTS//,/ }

View File

@ -1,2 +1,5 @@
export DISTRO_NAME=fedora
export DIB_RELEASE=${DIB_RELEASE:-24}
if [ -n "${DIB_FEDORA_DISTRIBUTION_MIRROR:-}" ]; then
export DIB_DISTRIBUTION_MIRROR=$DIB_FEDORA_DISTRIBUTION_MIRROR
fi

View File

@ -1,4 +1,8 @@
export DISTRO_NAME=ubuntu
export DIB_RELEASE=${DIB_RELEASE:-xenial}
export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe}
if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then
DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR
fi
export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://archive.ubuntu.com/ubuntu}