Merge "Creating first pass of robot tests."
[releng/builder.git] / jjb / integration / include-raw-integration-get-bundle-vars.sh
1 echo "#################################################"
2 echo "## include-raw-integration-get-bundle_vars.txt ##"
3 echo "#################################################"
4 set -x
5 # Create a script to run controller inside a dynamic jenkins slave
6 CONTROLLERMEM="2048m"
7 DISTRIBUTION="karaf"
8
9
10
11 if [ ${CONTROLLERSCOPE} == 'all' ]; then
12     CONTROLLERFEAT="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
13     CONTROLLERMEM="3072m"
14 else
15     CONTROLLERFEAT="${CONTROLLERFEATURES}"
16 fi
17
18 NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
19
20 if [ ${BUNDLEURL} == 'last' ]; then
21     NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
22     # Extract the BUNDLEVERSION from the pom.xml
23     BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
24     echo "Bundle version is ${BUNDLEVERSION}"
25     # Acquire the timestamp information from maven-metadata.xml
26     wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
27     less maven-metadata.xml
28     TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
29     echo "Nexus timestamp is ${TIMESTAMP}"
30     BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
31     BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
32     BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
33 else
34     BUNDLE="${BUNDLEURL##*/}"
35     BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
36     BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
37 fi
38
39 echo "Distribution bundle URL is ${BUNDLEURL}"
40 echo "Distribution bundle is ${BUNDLE}"
41 echo "Distribution folder is ${BUNDLEFOLDER}"
42
43
44 # write the BUNDLE values into a HERE doc to later
45 #  export to jenkins
46
47 cat > ${WORKSPACE}/bundle_vars.txt <<EOF
48 CONTROLLERFEAT=${CONTROLLERFEAT}
49 CONTROLLERMEM=${CONTROLLERMEM}
50 DISTRIBUTION=${DISTRIBUTION}
51 TIMESTAMP=${TIMESTAMP}
52 NEXUSURL_PREFIX=${NEXUSURL_PREFIX}
53 NEXUSPATH=${NEXUSPATH}
54 BUNDLEVERSION=${BUNDLEVERSION}
55 BUNDLEFOLDER=${BUNDLEFOLDER}
56 BUNDLE=${BUNDLE}
57 ACTUALBUNDLEURL=${BUNDLEURL}
58 EOF
59 set +x
60 ls
61 echo "#################################################"
62 echo "## include-raw-integration-get-bundle_vars.txt ##"
63 echo "#################################################"
64
65