Allow for multiple forbidden paths
[releng/builder.git] / jjb / integration / integration-compare-distributions.sh
index 6e48b2d23cd593758e1616e76c7fffb2d33f76ac..9dfede50fd0e4880ff448401c642e0fcd5f0bca1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 
 # Depends on variables created and published from the integration-set-variables script
 
@@ -13,6 +13,14 @@ DISTROBRANCH=${DISTROBRANCH:-$GERRIT_BRANCH}
 # Obtain current pom.xml of integration/distribution, correct branch.
 if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
     wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=opendaylight/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
+elif [[ "$KARAF_ARTIFACT" == "karaf" ]]; then
+    wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
+elif [[ "$KARAF_ARTIFACT" == "netconf-karaf" ]]; then
+    wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
+elif [[ "$KARAF_ARTIFACT" == "controller-test-karaf" ]]; then
+    wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
+elif [[ "$KARAF_ARTIFACT" == "bgpcep-karaf" ]]; then
+    wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=distribution-karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
 else
     wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
 fi
@@ -21,7 +29,7 @@ fi
 BUNDLE_VERSION=$(xpath pom.xml '/project/version/text()' 2> /dev/null)
 echo "Bundle version is ${BUNDLE_VERSION}"
 # Acquire the timestamp information from maven-metadata.xml
-NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/integration/${KARAF_ARTIFACT}"
+NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/${KARAF_PROJECT}/${KARAF_ARTIFACT}"
 wget "${NEXUSPATH}/${BUNDLE_VERSION}/maven-metadata.xml"
 
 # shellcheck disable=SC2181
@@ -61,3 +69,15 @@ mkdir -p "$WORKSPACE"/archives
 python distcompare.py -r "ssh://jenkins-$SILO@git.opendaylight.org:29418" | tee /tmp/dist_diff.txt
 echo -e "Patch differences listed are in comparison to:\n\t$ACTUAL_BUNDLE_URL\n\n" > "$WORKSPACE"/archives/distribution_differences.txt
 sed -ne '/Patch differences/,$ p' /tmp/dist_diff.txt >> "$WORKSPACE"/archives/distribution_differences.txt
+
+# Check OpenDaylight YANG modules:
+echo "Installing pyang"
+pip install --user pyang
+if [ -f /tmp/distro_new/bin/extract_modules.sh ]; then
+    echo "Extracting YANG modules"
+    /tmp/distro_new/bin/extract_modules.sh
+    echo "Checking YANG modules"
+    /tmp/distro_new/bin/check_modules.sh
+    mv /tmp/distro_new/opendaylight-models "$WORKSPACE"/archives
+fi
+