2018-10-09 23:50:34 +00:00
|
|
|
# Set DIB_DISTRIBUTION_MIRROR and related if running in openstack gate
|
2017-06-20 19:37:06 +00:00
|
|
|
|
2018-10-09 23:50:34 +00:00
|
|
|
# don't spam logs with this source
|
|
|
|
_xtrace=$(set +o | grep xtrace)
|
|
|
|
set +o xtrace
|
2017-06-20 19:37:06 +00:00
|
|
|
|
2018-10-09 23:50:34 +00:00
|
|
|
if [ -f /etc/ci/mirror_info.sh ]; then
|
|
|
|
# outside chroot
|
|
|
|
mirror_info=/etc/ci/mirror_info.sh
|
|
|
|
elif [ -f /tmp/in_target.d/mirror_info.sh ]; then
|
|
|
|
# inside chroot
|
|
|
|
mirror_info=/tmp/in_target.d/mirror_info.sh
|
|
|
|
else
|
|
|
|
echo "No mirror file found. Not an OpenStack CI node?"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
source $mirror_info
|
|
|
|
$_xtrace
|
|
|
|
|
|
|
|
# note 11- is after 10- which is where DISTRO_NAME is set usually
|
|
|
|
|
|
|
|
if [[ "${DISTRO_NAME}" == "ubuntu" ]]; then
|
2019-08-14 05:43:46 +00:00
|
|
|
if [[ "${ARCH}" == "arm64" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=${NODEPOOL_UBUNTU_PORTS_MIRROR}
|
|
|
|
elif [[ "${ARCH}" == "amd64" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_UBUNTU_MIRROR
|
|
|
|
fi
|
2018-10-09 23:50:34 +00:00
|
|
|
export DIB_DEBOOTSTRAP_EXTRA_ARGS+=" --no-check-gpg"
|
|
|
|
elif [[ "${DISTRO_NAME}" == "debian" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_DEBIAN_MIRROR
|
|
|
|
export DIB_DEBOOTSTRAP_EXTRA_ARGS+=" --no-check-gpg"
|
|
|
|
elif [[ "${DISTRO_NAME}" == "fedora" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_FEDORA_MIRROR
|
|
|
|
elif [[ "${DISTRO_NAME}" == "centos" ]]; then
|
2021-08-31 23:24:36 +00:00
|
|
|
if [[ "${DIB_RELEASE}" == '9-stream' ]]; then
|
|
|
|
# NOTE(ianw) 2021-10-18 : no 9-stream mirrors, yet
|
|
|
|
:
|
|
|
|
else
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_CENTOS_MIRROR
|
|
|
|
export DIB_EPEL_MIRROR=$NODEPOOL_EPEL_MIRROR
|
|
|
|
fi
|
2018-10-09 23:50:34 +00:00
|
|
|
elif [[ "${DISTRO_NAME}" == "centos7" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_CENTOS_MIRROR
|
|
|
|
export DIB_EPEL_MIRROR=$NODEPOOL_EPEL_MIRROR
|
|
|
|
elif [[ "${DISTRO_NAME}" == "opensuse" ]]; then
|
|
|
|
export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_OPENSUSE_MIRROR
|
2017-06-20 19:37:06 +00:00
|
|
|
fi
|
2017-06-20 00:42:10 +00:00
|
|
|
|
2018-10-15 05:00:18 +00:00
|
|
|
# Infra doesn't mirror non-free repos, so instruct to ignore these
|
|
|
|
export DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE="(universe|multiverse)"
|
|
|
|
export DIB_DISTRIBUTION_MIRROR_UBUNTU_INSECURE=1
|
|
|
|
|
|
|
|
# These repo files are pre-created for the fedora/centos-minimal jobs
|
|
|
|
# in the gate. Not relevant inside the chroot.
|
2018-05-23 02:11:13 +00:00
|
|
|
if [[ -d ${DIB_OS_CI_YUM_REPOS:-/not/a/path/} ]]; then
|
2017-06-20 00:42:10 +00:00
|
|
|
|
|
|
|
if [[ "${DISTRO_NAME}" == "fedora" ]]; then
|
2018-05-23 02:11:13 +00:00
|
|
|
if [[ -d ${DIB_OS_CI_YUM_REPOS}/fedora-minimal/${DIB_RELEASE} ]]; then
|
|
|
|
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/fedora-minimal/${DIB_RELEASE}/yum.repos.d
|
|
|
|
else
|
|
|
|
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/fedora-minimal/default/yum.repos.d
|
|
|
|
fi
|
2017-06-20 00:42:10 +00:00
|
|
|
elif [[ "${DISTRO_NAME}" == "centos" ]]; then
|
2019-09-25 00:53:39 +00:00
|
|
|
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/centos-minimal/${DIB_RELEASE}/yum.repos.d
|
2021-04-01 02:13:12 +00:00
|
|
|
elif [[ "${DISTRO_NAME}" == "openeuler" ]]; then
|
|
|
|
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/openeuler-minimal/${DIB_RELEASE}/yum.repos.d
|
2017-06-20 00:42:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
2018-10-09 23:50:34 +00:00
|
|
|
|