Move distribution template to releng
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-controller-offline.sh
index 077c56ed5779f7575b68ed5204048e3325bcb9e9..e5ff0e759060212145f2b51088279d09a26b97dc 100644 (file)
@@ -3,8 +3,10 @@ DISTRIBUTION="karaf"
 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}"
@@ -16,18 +18,16 @@ if [ ${BUNDLEURL} == 'last' ]; then
     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..."
@@ -67,7 +67,7 @@ echo "sleeping for 20 seconds..."
 sleep 20
 
 echo "Check OSGi bundles..."
-./client "feature:install ${CONTROLLERFEATURES}" || echo $? > ${WORKSPACE}/error.txt
+sshpass -p karaf ./client -u karaf "feature:install ${CONTROLLERFEATURES}" || echo $? > ${WORKSPACE}/error.txt
 
 echo "Fetching Karaf log"
 cd ${WORKSPACE}