Merge "Add script for gpg signing artifacts"
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-controller.sh
1 echo "#################################################"
2 echo "##       Install Distribution in Cluster       ##"
3 echo "#################################################"
4
5 CONTROLLERMEM="2048m"
6
7 if [ ${CONTROLLERSCOPE} == 'all' ]; then
8     ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
9     CONTROLLERMEM="3072m"
10 else
11     ACTUALFEATURES="${CONTROLLERFEATURES}"
12 fi
13
14 cat > ${WORKSPACE}/deploy-controller-script.sh <<EOF
15
16 if [ ${JDKVERSION} == 'openjdk8' ]; then
17     echo "Setting the JDK Version to 8"
18     sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64/jre/bin/java
19     export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64
20     java -version
21 fi
22 if [ ${JDKVERSION} == 'openjdk7' ]; then
23     echo "Setting the JDK Version to 7"
24     sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64/jre/bin/java
25     export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64
26     java -version
27 fi
28
29 echo "Changing to /tmp"
30 cd /tmp
31
32 echo "Downloading the distribution from ${ACTUALBUNDLEURL}"
33 wget --no-verbose  '${ACTUALBUNDLEURL}'
34
35 echo "Extracting the new controller..."
36 unzip -q ${BUNDLE}
37
38 echo "Configuring the startup features..."
39 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
40 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
41 sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features%g" \${FEATURESCONF}
42 cat \${FEATURESCONF}
43
44 echo "Configuring the log..."
45 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
46 sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF}
47 # FIXME: Make log size limit configurable from build parameter.
48 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF}
49 cat \${LOGCONF}
50
51 echo "Configure max memory..."
52 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
53 sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF}
54 cat \${MEMCONF}
55
56 echo "Listing all open ports on controller system"
57 netstat -natu
58
59 echo "JDK Version ..."
60 java -version
61
62 EOF
63
64 for i in `seq 1 ${NUM_ODL_SYSTEM}`
65 do
66     CONTROLLERIP=ODL_SYSTEM_${i}_IP 
67     echo "Installing distribution in member-${i} with IP address ${!CONTROLLERIP}"
68     scp ${WORKSPACE}/deploy-controller-script.sh ${!CONTROLLERIP}:/tmp
69     ssh ${!CONTROLLERIP} 'bash /tmp/deploy-controller-script.sh'
70 done
71
72 # vim: ts=4 sw=4 sts=4 et ft=sh :
73