mapfile -t ips <<< "$(openstack stack show -f json -c outputs "$STACK_NAME" | jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]')"
for ip in "${ips[@]}"; do
echo "Copying common-functions.sh to ${ip}:/tmp"
- scp /tmp/common-functions.sh ${ip}:/tmp
+ scp /tmp/common-functions.sh "${ip}:/tmp"
done
exit 0
fi
echo "Bundle version is ${BUNDLE_VERSION}"
# Acquire the timestamp information from maven-metadata.xml
NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/integration/${KARAF_ARTIFACT}"
-wget ${NEXUSPATH}/${BUNDLE_VERSION}/maven-metadata.xml
+wget "${NEXUSPATH}/${BUNDLE_VERSION}/maven-metadata.xml"
+# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "unable to find maven-metadata.xml. no need to continue..."
exit 0
BUNDLE="${KARAF_ARTIFACT}-${TIMESTAMP}.zip"
ACTUAL_BUNDLE_URL="${NEXUSPATH}/${BUNDLE_VERSION}/${BUNDLE}"
-wget --progress=dot:mega $ACTUAL_BUNDLE_URL
+wget --progress=dot:mega "$ACTUAL_BUNDLE_URL"
echo "Extracting the last distribution found on nexus..."
-unzip -q $BUNDLE
-mv $BUNDLEFOLDER /tmp/distro_old
-rm $BUNDLE
+unzip -q "$BUNDLE"
+mv "$BUNDLEFOLDER" /tmp/distro_old
+rm "$BUNDLE"
echo "Extracting the distribution just created by this job..."
-NEW_DISTRO="$(find $WORKSPACE -name "${KARAF_ARTIFACT}*.zip")"
+NEW_DISTRO="$(find "$WORKSPACE" -name "${KARAF_ARTIFACT}*.zip")"
NEW_DISTRO_BASENAME="$(basename "$NEW_DISTRO")"
-cp $NEW_DISTRO /tmp/
+cp "$NEW_DISTRO" /tmp/
cd /tmp/ || exit
-unzip $NEW_DISTRO_BASENAME
-mv $BUNDLEFOLDER distro_new
+unzip "$NEW_DISTRO_BASENAME"
+mv "$BUNDLEFOLDER" distro_new
git clone https://git.opendaylight.org/gerrit/integration/test.git
cd test/tools/distchanges || exit
-mkdir -p $WORKSPACE/archives
+mkdir -p "$WORKSPACE"/archives
# Full output of compare tool will be in temp file /tmp/dist_diff.txt
# The file/report to be archived will only list the distribution in the comparison and the patches that
# are different.
-python distcompare.py -r ssh://jenkins-$SILO@git.opendaylight.org:29418 | tee /tmp/dist_diff.txt
-echo -e "Patch differences listed are in comparison to:\n\t$ACTUAL_BUNDLE_URL\n\n" > $WORKSPACE/archives/distribution_differences.txt
-sed -ne '/Patch differences/,$ p' /tmp/dist_diff.txt >> $WORKSPACE/archives/distribution_differences.txt
+python distcompare.py -r "ssh://jenkins-$SILO@git.opendaylight.org:29418" | tee /tmp/dist_diff.txt
+echo -e "Patch differences listed are in comparison to:\n\t$ACTUAL_BUNDLE_URL\n\n" > "$WORKSPACE"/archives/distribution_differences.txt
+sed -ne '/Patch differences/,$ p' /tmp/dist_diff.txt >> "$WORKSPACE"/archives/distribution_differences.txt
+#!/bin/bash
#@IgnoreInspection BashAddShebang
# Activate robotframework virtualenv
# ${ROBOT_VENV} comes from the integration-install-robotframework.sh
# script.
-# shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source ${ROBOT_VENV}/bin/activate
-source /tmp/common-functions.sh ${BUNDLEFOLDER}
+# shellcheck disable=SC1090,SC1091
+source "${ROBOT_VENV}/bin/activate"
+source /tmp/common-functions.sh "${BUNDLEFOLDER}"
echo "#################################################"
echo "## Configure Cluster and Start ##"
-
+#!/bin/bash
# TODO: Document the default values.
NEXUSURL_PREFIX="${ODLNEXUSPROXY:-https://nexus.opendaylight.org}"
ODL_NEXUS_REPO="${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}"
GERRIT_PATH="${GERRIT_PATH:-git.opendaylight.org/gerrit}"
DISTROBRANCH="${DISTROBRANCH:-$GERRIT_BRANCH}"
-if [ ${BUNDLE_URL} == 'last' ]; then
+if [ "${BUNDLE_URL}" == 'last' ]; then
# Obtain current pom.xml of integration/distribution, correct branch.
if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=opendaylight/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
OPENSTACK_CONTROL_NODE_1_IP=$ODL_SYSTEM_IP
ODL_SYSTEM_1_IP=$ODL_SYSTEM_IP
+# shellcheck disable=SC2129
echo "NUM_OPENSTACK_SYSTEM=$NUM_OPENSTACK_SYSTEM" >> slave_addresses.txt
echo "NUM_ODL_SYSTEM=$NUM_ODL_SYSTEM" >> slave_addresses.txt
echo "ODL_SYSTEM_IP=$ODL_SYSTEM_IP" >> slave_addresses.txt
VM_NAME="$JOB_SUM-$BUILD_NUMBER"
SERVER_ID="$(openstack server show -f value -c id "$(hostname -s)")"
NETWORK_ID="$(openstack network show -f value -c id "$SILO-$VM_NAME-APEX_192_network")"
-openstack server add network $SERVER_ID $NETWORK_ID
+openstack server add network "$SERVER_ID" "$NETWORK_ID"
ETH1_MAC=$(ip address show eth1 | grep ether | awk -F' ' '{print $2}')
ETH1_SCRIPT="/etc/sysconfig/network-scripts/ifcfg-eth1"
sudo cp /etc/sysconfig/network-scripts/ifcfg-eth0 "$ETH1_SCRIPT"
-DrepositoryId=opendaylight-snapshot \
-Durl="$ODLNEXUSPROXY/content/repositories/opendaylight.snapshot/" \
-DgroupId="org.opendaylight.integration.${GERRIT_PROJECT//\//.}" \
- -DartifactId=${KARAF_ARTIFACT} \
+ -DartifactId="${KARAF_ARTIFACT}" \
-Dversion="${BUNDLE_VERSION}" \
-Dpackaging=zip \
|| true # Sandbox is not allowed to uplad to Nexus.
jobs_file=$(mktemp)
search_string="csit"
-wget --quiet -O "$jobs_file" https://jenkins.opendaylight.org/$SILO/api/xml
+wget --quiet -O "$jobs_file" "https://jenkins.opendaylight.org/$SILO/api/xml"
# shellcheck disable=SC2207
jobs=($(xmlstarlet sel -t -m '//hudson/job' \
- -n -v 'name' "$jobs_file" | grep $search_string | grep $STREAM))
+ -n -v 'name' "$jobs_file" | grep $search_string | grep "$STREAM"))
# output as comma-separated list
job_list="${WORKSPACE}/jjb/integration/csit-jobs-${STREAM}.lst"