Merge "Add OVS 2.4.0 to ovsdb full integration"
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-controller-offline.sh
1 CONTROLLERMEM="3072m"
2 ACTUALFEATURES="odl-integration-all"
3
4 echo "Kill any controller running"
5 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
6
7 echo "Clean workspace"
8 rm -rf *
9
10 echo "Downloading the distribution..."
11 wget --no-verbose  ${ACTUALBUNDLEURL}
12
13 echo "Extracting the new controller..."
14 unzip -q ${BUNDLE}
15
16 echo "Configuring the startup features..."
17 FEATURESCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
18 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}
19 cat ${FEATURESCONF}
20
21 echo "Configuring the log..."
22 LOGCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
23 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/g' ${LOGCONF}
24 cat ${LOGCONF}
25
26 echo "Configure the repos..."
27 REPOCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.url.mvn.cfg
28 sed -ie '/http/d' ${REPOCONF}
29 sed -ie '$s/...$//' ${REPOCONF}
30 cat ${REPOCONF}
31
32 echo "Configure max memory..."
33 MEMCONF=${WORKSPACE}/${BUNDLEFOLDER}/bin/setenv
34 sed -ie "s/2048m/${CONTROLLERMEM}/g" ${MEMCONF}
35 cat ${MEMCONF}
36
37 echo "Starting controller..."
38 ${WORKSPACE}/${BUNDLEFOLDER}/bin/start
39
40 echo "sleeping for 10 seconds..."
41 sleep 10
42
43 echo "Install all features"
44 sshpass -p karaf ${WORKSPACE}/${BUNDLEFOLDER}/bin/client -u karaf "feature:install ${ACTUALFEATURES}" || echo $? > ${WORKSPACE}/error.txt
45
46 echo "Fetching Karaf log"
47 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log .
48
49 echo "Kill controller"
50 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
51
52 echo "Exit with error"
53 if [ -f ${WORKSPACE}/error.txt ]; then
54     echo "Failed to deploy offline"
55     exit 1
56 fi
57
58 # vim: ts=4 sw=4 sts=4 et ft=sh :
59