Merge "Add boolean parameter to run test after build"
[releng/builder.git] / jjb / integration / include-raw-integration-get-bundle-vars.sh
index dcdf3aebb772c909d56b38d1cdb386f946848b95..6b57c40272c8262ae5a7e4d9524b41f91de19928 100644 (file)
@@ -5,11 +5,11 @@ echo "#################################################"
 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}
-BRANCH=${GERRIT_BRANCH:-BRANCH}
+DISTROBRANCH=${DISTROBRANCH:-$GERRIT_BRANCH}
 
 if [ ${BUNDLEURL} == 'last' ]; then
     # Obtain current pom.xml of integration/distribution, correct branch.
-    wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$BRANCH" -O "pom.xml"
+    wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
     # Extract the BUNDLEVERSION from the pom.xml
     BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
     echo "Bundle version is ${BUNDLEVERSION}"
@@ -22,11 +22,16 @@ if [ ${BUNDLEURL} == 'last' ]; then
     BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
     BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
     ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
-else
+elif [[ ${BUNDLEURL} == *"distribution-check"* ]]; then
     ACTUALBUNDLEURL="${BUNDLEURL}"
     BUNDLE="${BUNDLEURL##*/}"
     BUNDLEFOLDER="${BUNDLE//.zip}"
     BUNDLEVERSION="${BUNDLEFOLDER//distribution-karaf-}"
+else
+    ACTUALBUNDLEURL="${BUNDLEURL}"
+    BUNDLE="${BUNDLEURL##*/}"
+    BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+    BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
 fi
 
 if [ ${JDKVERSION} == 'openjdk8' ]; then