Merge "Handle bundle-vars directly in dist-compare script"
authorLuis Gomez <ecelgp@gmail.com>
Wed, 12 Apr 2017 17:34:44 +0000 (17:34 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 12 Apr 2017 17:34:44 +0000 (17:34 +0000)
jjb/integration/distribution-jobs.yaml
jjb/integration/include-raw-integration-compare-distributions.sh

index 4a62e56b995d94310c82ce6d7d115faf47c6ca92..3e837ff42023b229f13c4f463af7e156d04b714d 100644 (file)
           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'
index ae172ad368ae3a452f72661455fe39092506a36b..ecd77675f6d7159bc0b57d801921191173d2d29c 100644 (file)
@@ -5,6 +5,32 @@
 # 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