kolla/tools/deploy_aio.sh
Mohammed Naser 4c7a4099ca Remove global privilege escalation for deploy_aio.sh
At the moment, deploy_aio.sh is called with sudo which results
in the environment being wiped.  This means that all Zuul
environment variables are removed and therefore when zuul-cloner
runs to checkout the branch of kolla-ansible, it will always
fallback to master as ZUUL_BRANCH is unset.

This patch removes the global usage of sudo in the tox.ini file
as there is existing usage of sudo in the bash script itself. This
will mean that we will only escalate privileges when needed rather
for the whole script and the environment variables should be passed
on properly resulting in the matching release of kolla-ansible being
checked out.

Closes-Bug: #1673756

Change-Id: I477a843e696be7136c020be6408afea01967879d
2017-03-18 14:13:53 -04:00

29 lines
639 B
Bash
Executable File

#!/bin/bash
set -o xtrace
set -o errexit
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export KOLLA_BASE=$1
export KOLLA_TYPE=$2
export KOLLA_ANSIBLE_DIR=$(mktemp -d)
cat > /tmp/clonemap <<EOF
clonemap:
- name: openstack/kolla-ansible
dest: ${KOLLA_ANSIBLE_DIR}
EOF
/usr/zuul-env/bin/zuul-cloner -m /tmp/clonemap --workspace "$(pwd)" \
--cache-dir /opt/git git://git.openstack.org \
openstack/kolla-ansible
pushd "${KOLLA_ANSIBLE_DIR}"
# Copy configs
sudo cp -a etc/kolla /etc/
# Generate passwords
sudo tools/generate_passwords.py
sudo ./tools/deploy_aio.sh "$KOLLA_BASE" "$KOLLA_TYPE"
popd