removing netconf connector from netconf scale suite for carbon
[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 ODL_NEXUS_REPO=${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}
7 GERRIT_PATH=${GERRIT_PATH:-git.opendaylight.org/gerrit}
8
9 if [ ${BUNDLEURL} == 'last' ]; then
10     # Obtain current pom.xml of integration/distribution, correct branch.
11     wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$BRANCH" -O "pom.xml"
12     # Extract the BUNDLEVERSION from the pom.xml
13     BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
14     echo "Bundle version is ${BUNDLEVERSION}"
15     # Acquire the timestamp information from maven-metadata.xml
16     NEXUSPATH="${NEXUSURL_PREFIX}/${ODL_NEXUS_REPO}/org/opendaylight/integration/distribution-karaf"
17     wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
18     less maven-metadata.xml
19     TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
20     echo "Nexus timestamp is ${TIMESTAMP}"
21     BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
22     BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
23     ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
24 else
25     ACTUALBUNDLEURL="${BUNDLEURL}"
26     BUNDLE="${BUNDLEURL##*/}"
27     BUNDLEFOLDER="${BUNDLE//.zip}"
28     BUNDLEVERSION="${BUNDLEFOLDER//distribution-karaf-}"
29 fi
30
31 if [ ${JDKVERSION} == 'openjdk8' ]; then
32     echo "Preparing for JRE Version 8"
33     JAVA_HOME="/usr/lib/jvm/java-1.8.0"
34 elif [ ${JDKVERSION} == 'openjdk7' ]; then
35     echo "Preparing for JRE Version 7"
36     JAVA_HOME="/usr/lib/jvm/java-1.7.0"
37 fi
38
39 echo "Distribution bundle URL is ${ACTUALBUNDLEURL}"
40 echo "Distribution bundle is ${BUNDLE}"
41 echo "Distribution bundle version is ${BUNDLEVERSION}"
42 echo "Distribution folder is ${BUNDLEFOLDER}"
43 echo "Nexus prefix is ${NEXUSURL_PREFIX}"
44 echo "Java home is ${JAVA_HOME}"
45
46 cat > ${WORKSPACE}/bundle_vars.txt <<EOF
47 ACTUALBUNDLEURL=${ACTUALBUNDLEURL}
48 BUNDLE=${BUNDLE}
49 BUNDLEVERSION=${BUNDLEVERSION}
50 BUNDLEFOLDER=${BUNDLEFOLDER}
51 NEXUSURL_PREFIX=${NEXUSURL_PREFIX}
52 JAVA_HOME=${JAVA_HOME}
53 EOF
54
55 # vim: ts=4 sw=4 sts=4 et ft=sh :
56