CONTROLLERFEATURES="odl-integration-compatible-with-all"
CONTROLLERMEM="3072m"
+ NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+
if [ ${BUNDLEURL} == 'last' ]; then
- NEXUSPATH="https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
+ NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
# Extract the BUNDLEVERSION from the pom.xml
BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
echo "Bundle version is ${BUNDLEVERSION}"
BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
else
- BUNDLE="$(echo ${BUNDLEURL} | awk -F '/' '{ print $(NF) }')"
- echo "Finding out Bundle folder..."
- wget --no-verbose ${BUNDLEURL}
- BUNDLEFOLDER="$(unzip -qql ${BUNDLE} | head -n1 | tr -s ' ' | cut -d' ' -f5- | rev | cut -c 2- | rev)"
- rm ${BUNDLE}
+ BUNDLE="${BUNDLEURL##*/}"
+ BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+ BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
fi
echo "Distribution bundle URL is ${BUNDLEURL}"
echo "Distribution bundle is ${BUNDLE}"
echo "Distribution folder is ${BUNDLEFOLDER}"
-echo "Downloading the distribution from ${BUNDLEURL}"
+echo "Downloading the distribution..."
wget --no-verbose ${BUNDLEURL}
echo "Extracting the new controller..."
CONTROLLERMEM="3072m"
fi
+ NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+
if [ ${BUNDLEURL} == 'last' ]; then
- NEXUSPATH="https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
+ NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
# Extract the BUNDLEVERSION from the pom.xml
BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
echo "Bundle version is ${BUNDLEVERSION}"
BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
else
- BUNDLE="$(echo ${BUNDLEURL} | awk -F '/' '{ print $(NF) }')"
- echo "Finding out Bundle folder..."
- wget --no-verbose ${BUNDLEURL}
- BUNDLEFOLDER="$(unzip -qql ${BUNDLE} | head -n1 | tr -s ' ' | cut -d' ' -f5- | rev | cut -c 2- | rev)"
- rm ${BUNDLE}
+ BUNDLE="${BUNDLEURL##*/}"
+ BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+ BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
fi
echo "Distribution bundle URL is ${BUNDLEURL}"
echo "Distribution folder is ${BUNDLEFOLDER}"
cat > ${WORKSPACE}/controller-script.sh <<EOF
-echo "Downloading the distribution from ${BUNDLEURL}"
+echo "Downloading the distribution..."
cd /tmp
-wget --no-verbose ${BUNDLEURL}
+wget --no-verbose '${BUNDLEURL}'
echo "Extracting the new controller..."
unzip -q ${BUNDLE}