fi
# Extract the BUNDLE_VERSION from the pom.xml
-BUNDLE_VERSION=$(xpath pom.xml '/project/version/text()' 2> /dev/null)
+# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+BUNDLE_VERSION=$(xpath -e '/project/version/text()' pom.xml 2>/dev/null ||
+ 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/${KARAF_PROJECT}/${KARAF_ARTIFACT}"
fi
less maven-metadata.xml
-TIMESTAMP=$(xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)
+# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+TIMESTAMP=$(xpath -e "//snapshotVersion[extension='zip'][1]/value/text()" maven-metadata.xml 2>/dev/null ||
+ xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)
echo "Nexus timestamp is ${TIMESTAMP}"
BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
BUNDLE="${KARAF_ARTIFACT}-${TIMESTAMP}.zip"
/tmp/distro_new/bin/check_modules.sh
mv /tmp/distro_new/opendaylight-models "$WORKSPACE"/archives
fi
-
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
fi
# Extract the BUNDLE_VERSION from the pom.xml
- BUNDLE_VERSION="$(xpath pom.xml '/project/version/text()' 2> /dev/null)"
+ # TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+ BUNDLE_VERSION=$(xpath -e '/project/version/text()' pom.xml 2>/dev/null ||
+ 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/${KARAF_PROJECT}/${KARAF_ARTIFACT}"
wget "${NEXUSPATH}/${BUNDLE_VERSION}/maven-metadata.xml"
less "maven-metadata.xml"
- TIMESTAMP="$(xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)"
+ # TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+ TIMESTAMP=$(xpath -e "//snapshotVersion[extension='zip'][1]/value/text()" maven-metadata.xml 2>/dev/null ||
+ xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null)
echo "Nexus timestamp is ${TIMESTAMP}"
BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
BUNDLE="${KARAF_ARTIFACT}-${TIMESTAMP}.zip"
#!/bin/bash
set -xeu -o pipefail
-BUNDLE_VERSION=$(xpath "${BUNDLE_POM}" '/project/version/text()' 2> /dev/null)
+# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+BUNDLE_VERSION=$(xpath -e '/project/version/text()' "${BUNDLE_POM}" 2>/dev/null ||
+ xpath "${BUNDLE_POM}" '/project/version/text()' 2>/dev/null)
BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
BUNDLE="${BUNDLEFOLDER}.zip"
BUNDLE_PATH="/tmp/r/org/opendaylight/${KARAF_PROJECT}/${KARAF_ARTIFACT}/${BUNDLE_VERSION}/${BUNDLE}"
mkdir -p "$WORKSPACE/archives"
echo "$staging_repo ${NEXUS_URL}/content/repositories/$staging_repo" | tee -a "$WORKSPACE/archives/staging-repo.txt"
-staged_version=$(find . -name '*karaf*.pom' -exec xpath {} '/project/version/text()' \; 2> /dev/null)
+# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+staged_version=$(find . -name '*karaf*.pom' -exec \
+ sh -c 'xpath -e "/project/version/text()" "$1" 2>/dev/null || xpath "$1" "/project/version/text()" 2>/dev/null' xpath.sh {} \;)
BUNDLE_URL="${NEXUS_URL}/content/repositories/$staging_repo/org/opendaylight/${PROJECT}/${KARAF_ARTIFACT}/${staged_version}/${KARAF_ARTIFACT}-${staged_version}.zip"
# Cleanup