Merge "Add stable/lithium for capwap"
[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 echo "Changing to /tmp"
17 cd /tmp
18
19 echo "Downloading the distribution from ${ACTUALBUNDLEURL}"
20 wget --no-verbose  ${ACTUALBUNDLEURL}
21
22 echo "Extracting the new controller..."
23 unzip -q ${BUNDLE}
24
25 echo "Configuring the startup features..."
26 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
27 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
28 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}
29 cat \${FEATURESCONF}
30
31 echo "Configuring the log..."
32 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
33 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/g' \${LOGCONF}
34 cat \${LOGCONF}
35
36 echo "Configure max memory..."
37 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
38 sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF}
39 cat \${MEMCONF}
40
41 EOF
42
43 CONTROLLERIPS=(${CONTROLLER0} ${CONTROLLER1} ${CONTROLLER2})
44 for i in "${!CONTROLLERIPS[@]}"
45 do
46     echo "Installing distribution in member-$i with IP address ${CONTROLLERIPS[$i]}"
47     scp ${WORKSPACE}/deploy-controller-script.sh ${CONTROLLERIPS[$i]}:/tmp
48     ssh ${CONTROLLERIPS[$i]} 'bash /tmp/deploy-controller-script.sh'
49 done
50
51 # vim: ts=4 sw=4 sts=4 et ft=sh :
52