8db436d954e2404e82385a9379bccf59482c037c
[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 # Some versions of jenkins job builder result in feature list containing spaces
14 # and ending in newline. Remove all that.
15 ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'`
16
17 cat > ${WORKSPACE}/deploy-controller-script.sh <<EOF
18
19 echo "Changing to /tmp"
20 cd /tmp
21
22 echo "Downloading the distribution from ${ACTUALBUNDLEURL}"
23 wget --no-verbose  '${ACTUALBUNDLEURL}'
24
25 echo "Extracting the new controller..."
26 unzip -q ${BUNDLE}
27
28 echo "Configuring the startup features..."
29 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
30 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
31 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}
32 cat \${FEATURESCONF}
33
34 echo "Configuring the log..."
35 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
36 sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF}
37 # FIXME: Make log size limit configurable from build parameter.
38 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF}
39 cat \${LOGCONF}
40
41 echo "Configure java home and max memory..."
42 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
43 sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF}
44 sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF}
45 cat \${MEMCONF}
46
47 EOF
48
49 for i in `seq 1 ${NUM_ODL_SYSTEM}`
50 do
51     CONTROLLERIP=ODL_SYSTEM_${i}_IP
52     echo "Installing distribution in member-${i} with IP address ${!CONTROLLERIP}"
53     scp ${WORKSPACE}/deploy-controller-script.sh ${!CONTROLLERIP}:/tmp
54     ssh ${!CONTROLLERIP} 'bash /tmp/deploy-controller-script.sh'
55 done
56
57 # vim: ts=4 sw=4 sts=4 et ft=sh :