#
# https://github.com/openstack-infra/project-config/blob/master/jenkins/jobs/networking-odl.yaml
-export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin
+export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin"
# *SIGH*. This is required to get lsb_release
sudo yum -y install redhat-lsb-core indent python-testrepository
sudo bash -c 'echo "stack ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers'
# We need to install some scripts from openstack/os-testr project
-cd ~
+cd ~ || exit 1
echo "Setting up infra scripts"
sudo mkdir -p /usr/local/jenkins/slave_scripts
git clone https://github.com/openstack/os-testr.git
-cd os-testr/os_testr
+cd os-testr/os_testr || exit 1
sudo cp subunit2html.py /usr/local/jenkins/slave_scripts
# Save existing WORKSPACE
-SAVED_WORKSPACE=$WORKSPACE
+SAVED_WORKSPACE="$WORKSPACE"
export WORKSPACE=~/workspace
-mkdir -p $WORKSPACE
-cd $WORKSPACE
+mkdir -p "$WORKSPACE"
+cd "$WORKSPACE" || exit 1
# This is the job which checks out devstack-gate
if [[ ! -e devstack-gate ]]; then
git clone https://git.openstack.org/openstack-infra/devstack-gate
else
echo "Fixing devstack-gate git remotes"
- cd devstack-gate
+ cd devstack-gate || exit 1
git remote set-url origin https://git.openstack.org/openstack-infra/devstack-gate
git remote update
git reset --hard
# Set the pieces we want to test
if [ "$GERRIT_PROJECT" == "openstack/neutron" ]; then
- ZUUL_PROJECT=$GERRIT_PROJECT
- ZUUL_BRANCH=$GERRIT_REFSPEC
+ export ZUUL_PROJECT=$GERRIT_PROJECT
+ export ZUUL_BRANCH=$GERRIT_REFSPEC
elif [ "$GERRIT_PROJECT" == "openstack-dev/devstack" ]; then
- ZUUL_PROJECT=$GERRIT_PROJECT
- ZUUL_BRANCH=$GERRIT_REFSPEC
+ export ZUUL_PROJECT=$GERRIT_PROJECT
+ export ZUUL_BRANCH=$GERRIT_REFSPEC
fi
echo "Setting environment variables"
DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MAX_PERM_MEM=784m;"
# Set ODL_URL_PREFIX if "nexus proxy" is provided
-URL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+export URL_PREFIX="${ODLNEXUSPROXY:-https://nexus.opendaylight.org}"
if [ -n "$ODLNEXUSPROXY" ] ; then
DEVSTACK_LOCAL_CONFIG+="ODL_URL_PREFIX=$ODLNEXUSPROXY;"
fi
DGRET=$?
# Restore WORKSPACE
-OS_WORKSPACE=$WORKSPACE
-export WORKSPACE=$SAVED_WORKSPACE
+OS_WORKSPACE="$WORKSPACE"
+export WORKSPACE="$SAVED_WORKSPACE"
# Copy and display all the logs
cat /opt/stack/new/devstacklog*
ls /opt/stack/; ls /opt/stack/new; ls /opt/stack/new/opendaylight;
-cp -r $OS_WORKSPACE/logs $WORKSPACE
-cp -a /opt/stack/new/logs/screen-odl-karaf* $WORKSPACE/logs
-mkdir -p $WORKSPACE/logs/opendaylight
-cp -a /opt/stack/new/opendaylight/distribution*/etc $WORKSPACE/logs/opendaylight
+cp -r "$OS_WORKSPACE/logs" "$WORKSPACE"
+cp -a /opt/stack/new/logs/screen-odl-karaf* "$WORKSPACE/logs"
+mkdir -p "$WORKSPACE/logs/opendaylight"
+cp -a /opt/stack/new/opendaylight/distribution*/etc "$WORKSPACE/logs/opendaylight"
# Unzip the logs to make them easier to view
-gunzip $WORKSPACE/logs/*.gz
+gunzip "$WORKSPACE"/logs/*.gz
-exit $DGRET
+exit "$DGRET"