-if [ ${BUNDLEURL} == 'last' ]; then
- NEXUSPATH="https://nexus.opendaylight.org/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"
- # Acquire the timestamp information from maven-metadata.xml
- wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
- TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
- echo "Nexus timestamp is $TIMESTAMP"
- BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
- BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
- BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
- echo "Distribution bundle URL is ${BUNDLEURL}"
-else
- BUNDLE="$(echo "$BUNDLEURL" | awk -F '/' '{ print $(NF) }')"
- BUNDLEFOLDER="${BUNDLE//.zip}"
-fi
+echo "Kill any controller running"
+ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
+
+echo "Clean workspace"
+rm -rf *