3 # Depends on variables created and published from the integration-set-variables script
5 # Do not fail the build if there is trouble trying to collect distribution patch diffs
8 NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
9 ODL_NEXUS_REPO=${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}
10 GERRIT_PATH=${GERRIT_PATH:-git.opendaylight.org/gerrit}
11 DISTROBRANCH=${DISTROBRANCH:-$GERRIT_BRANCH}
13 # Obtain current pom.xml of integration/distribution, correct branch.
14 if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
15 wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=opendaylight/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
17 wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
20 # Extract the BUNDLE_VERSION from the pom.xml
21 BUNDLE_VERSION=$(xpath pom.xml '/project/version/text()' 2> /dev/null)
22 echo "Bundle version is ${BUNDLE_VERSION}"
23 # Acquire the timestamp information from maven-metadata.xml
24 NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/integration/${KARAF_ARTIFACT}"
25 wget ${NEXUSPATH}/${BUNDLE_VERSION}/maven-metadata.xml
28 echo "unable to find maven-metadata.xml. no need to continue..."
32 less maven-metadata.xml
33 TIMESTAMP=$(xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)
34 echo "Nexus timestamp is ${TIMESTAMP}"
35 BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
36 BUNDLE="${KARAF_ARTIFACT}-${TIMESTAMP}.zip"
37 ACTUAL_BUNDLE_URL="${NEXUSPATH}/${BUNDLE_VERSION}/${BUNDLE}"
39 wget --progress=dot:mega $ACTUAL_BUNDLE_URL
40 echo "Extracting the last distribution found on nexus..."
42 mv $BUNDLEFOLDER /tmp/distro_old
45 echo "Extracting the distribution just created by this job..."
46 NEW_DISTRO="$(find $WORKSPACE -name "${KARAF_ARTIFACT}*.zip")"
47 NEW_DISTRO_BASENAME="$(basename "$NEW_DISTRO")"
50 unzip $NEW_DISTRO_BASENAME
51 mv $BUNDLEFOLDER distro_new
53 git clone https://git.opendaylight.org/gerrit/p/integration/test.git
54 cd test/tools/distchanges || exit
55 mkdir -p $WORKSPACE/archives
57 # Full output of compare tool will be in temp file /tmp/dist_diff.txt
58 # The file/report to be archived will only list the distribution in the comparison and the patches that
60 python distcompare.py -r ssh://jenkins-$SILO@git.opendaylight.org:29418 | tee /tmp/dist_diff.txt
61 echo -e "Patch differences listed are in comparison to:\n\t$ACTUAL_BUNDLE_URL\n\n" > $WORKSPACE/archives/distribution_differences.txt
62 sed -ne '/Patch differences/,$ p' /tmp/dist_diff.txt >> $WORKSPACE/archives/distribution_differences.txt