Step 2: Change csit job templates to download 2 repositories
[releng/builder.git] / jjb / integration / include-raw-integration-get-bundle-vars.sh
1 echo "#################################################"
2 echo "##       Inject Global Variables               ##"
3 echo "#################################################"
4
5 NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
6
7 if [ ${BUNDLEURL} == 'last' ]; then
8     NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf"
9     # Extract the BUNDLEVERSION from the pom.xml
10     BUNDLEVERSION=`xpath distribution/pom.xml '/project/version/text()' 2> /dev/null`
11     echo "Bundle version is ${BUNDLEVERSION}"
12     # Acquire the timestamp information from maven-metadata.xml
13     wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
14     less maven-metadata.xml
15     TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
16     echo "Nexus timestamp is ${TIMESTAMP}"
17     BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
18     BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
19     ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
20 else
21     ACTUALBUNDLEURL="${BUNDLEURL}"
22     BUNDLE="${BUNDLEURL##*/}"
23     BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
24     BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
25 fi
26
27 echo "Distribution bundle URL is ${ACTUALBUNDLEURL}"
28 echo "Distribution bundle is ${BUNDLE}"
29 echo "Distribution bundle version is ${BUNDLEVERSION}"
30 echo "Distribution folder is ${BUNDLEFOLDER}"
31 echo "Nexus prefix is ${NEXUSURL_PREFIX}"
32
33 cat > ${WORKSPACE}/bundle_vars.txt <<EOF
34 ACTUALBUNDLEURL=${ACTUALBUNDLEURL}
35 BUNDLE=${BUNDLE}
36 BUNDLEVERSION=${BUNDLEVERSION}
37 BUNDLEFOLDER=${BUNDLEFOLDER}
38 NEXUSURL_PREFIX=${NEXUSURL_PREFIX}
39 EOF
40
41 # vim: ts=4 sw=4 sts=4 et ft=sh :
42