summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-08-20 10:30:17 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-08-20 22:28:13 +0800
commit2e0c5ecbf8ea1dfa6749e5515a38ecfa58764312 (patch)
tree26c6d14e1a80e230ef4b75c944b43c53119c7108 /tools
parentf2a2b69c6a73f3eb342c1d05ec984e11be5e0dfa (diff)
downloadkolla-2e0c5ecbf8ea1dfa6749e5515a38ecfa58764312.tar.gz
kolla-2e0c5ecbf8ea1dfa6749e5515a38ecfa58764312.zip
Fix Ubuntu source gate deployment
In CI environment, MySQL-python wheel package has a wrong _mysql.so file, which is not compatible with Ubuntu. Disable wheel index in the CI for pip. Closes-Bug: #1615231 Change-Id: I127ebb017e09a5bf245e0fdad9bf052203e68e55
Diffstat (limited to 'tools')
-rwxr-xr-xtools/setup_gate.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh
index a1e10c49e..671181747 100755
--- a/tools/setup_gate.sh
+++ b/tools/setup_gate.sh
@@ -6,6 +6,12 @@ set -o errexit
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
+source /etc/nodepool/provider
+
+NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_CLOUD.openstack.org}
+NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
+NODEPOOL_PYPI_MIRROR=${NODEPOOL_PYPI_MIRROR:-http://$NODEPOOL_MIRROR_HOST/pypi/simple}
+
# Just for mandre :)
if [[ ! -f /etc/sudoers.d/jenkins ]]; then
echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins
@@ -19,8 +25,17 @@ function setup_config {
# Generate passwords
sudo tools/generate_passwords.py
- # Use Infra provided pypi
- echo "RUN echo $(base64 -w0 /etc/pip.conf) | base64 -d > /etc/pip.conf" | sudo tee /etc/kolla/header
+ # Use Infra provided pypi.
+ # Wheel package mirror may be not compatible. So do not enable it.
+ PIP_CONF=$(mktemp)
+ cat > ${PIP_CONF} <<EOF
+[global]
+timeout = 60
+index-url = $NODEPOOL_PYPI_MIRROR
+trusted-host = $NODEPOOL_MIRROR_HOST
+EOF
+ echo "RUN echo $(base64 -w0 ${PIP_CONF}) | base64 -d > /etc/pip.conf" | sudo tee /etc/kolla/header
+ rm ${PIP_CONF}
sed -i 's|^#include_header.*|include_header = /etc/kolla/header|' /etc/kolla/kolla-build.conf
if [[ "${DISTRO}" == "Debian" ]]; then