1 echo "#################################################"
2 echo "## Inject Global Variables ##"
3 echo "#################################################"
5 NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
7 if [ ${BUNDLEURL} == 'last' ]; then
8 # Obtain current pom.xml of integration/distribution, correct branch.
9 wget "http://git.opendaylight.org/gerrit/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$BRANCH" -O "pom.xml"
10 # Extract the BUNDLEVERSION from the pom.xml
11 BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
12 echo "Bundle version is ${BUNDLEVERSION}"
13 # Acquire the timestamp information from maven-metadata.xml
14 NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf"
15 wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
16 less maven-metadata.xml
17 TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
18 echo "Nexus timestamp is ${TIMESTAMP}"
19 BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
20 BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
21 ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
23 ACTUALBUNDLEURL="${BUNDLEURL}"
24 BUNDLE="${BUNDLEURL##*/}"
25 BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
26 BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
29 echo "Distribution bundle URL is ${ACTUALBUNDLEURL}"
30 echo "Distribution bundle is ${BUNDLE}"
31 echo "Distribution bundle version is ${BUNDLEVERSION}"
32 echo "Distribution folder is ${BUNDLEFOLDER}"
33 echo "Nexus prefix is ${NEXUSURL_PREFIX}"
35 cat > ${WORKSPACE}/bundle_vars.txt <<EOF
36 ACTUALBUNDLEURL=${ACTUALBUNDLEURL}
38 BUNDLEVERSION=${BUNDLEVERSION}
39 BUNDLEFOLDER=${BUNDLEFOLDER}
40 NEXUSURL_PREFIX=${NEXUSURL_PREFIX}
43 # vim: ts=4 sw=4 sts=4 et ft=sh :