branch: '{branch}'
refspec: 'refs/heads/{branch}'
artifacts: '{archive-artifacts} **/dependency_tree.txt **/*.hprof **/target/surefire-reports/*-output.txt'
- - integration-bundleurl:
- bundleurl: 'last'
scm:
- gerrit-trigger-scm:
refspec: ''
prebuilders:
- wipe-org-opendaylight-repo
- jacoco-nojava-workaround
- - integration-get-bundle-vars
- - inject:
- properties-file: 'bundle_vars.txt'
- provide-maven-settings:
global-settings-file: 'odl-global-settings'
settings-file: 'integration-settings'
# Do not fail the build if there is trouble trying to collect distribution patch diffs
set +e
+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}
+
+# 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/$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}"
+# Acquire the timestamp information from maven-metadata.xml
+NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/integration/distribution-karaf"
+wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
+
+if [ $? -ne 0 ]; then
+ echo "unable to find maven-metadata.xml. no need to continue..."
+ exit 0
+fi
+
+less maven-metadata.xml
+TIMESTAMP=$(xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)
+echo "Nexus timestamp is ${TIMESTAMP}"
+BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
+BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
+ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
+
wget --progress=dot:mega $ACTUALBUNDLEURL
echo "Extracting the last distribution found on nexus..."
unzip -q $BUNDLE