X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-deploy-controller-offline.sh;h=860256f458215f22cb25c54dd86c7750dc69e5fe;hb=3d0ba348a751815a99bcbd19c41e46e005a3dde9;hp=e5ff0e759060212145f2b51088279d09a26b97dc;hpb=3b124d322fcd7d9068ee7ea804aeefb94f85eff9;p=releng%2Fbuilder.git diff --git a/jjb/integration/include-raw-integration-deploy-controller-offline.sh b/jjb/integration/include-raw-integration-deploy-controller-offline.sh index e5ff0e759..860256f45 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-offline.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-offline.sh @@ -1,12 +1,9 @@ -# Create a script to run controller inside a dynamic jenkins slave -DISTRIBUTION="karaf" -CONTROLLERFEATURES="odl-integration-compatible-with-all" -CONTROLLERMEM="3072m" - NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org} +CONTROLLERMEM="3072m" +ACTUALFEATURES="odl-integration-compatible-with-all" if [ ${BUNDLEURL} == 'last' ]; then - NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}" + NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf" # Extract the BUNDLEVERSION from the pom.xml BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null` echo "Bundle version is ${BUNDLEVERSION}" @@ -14,64 +11,60 @@ if [ ${BUNDLEURL} == 'last' ]; then wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null` echo "Nexus timestamp is ${TIMESTAMP}" - BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}" - BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip" - BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}" + BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}" + BUNDLE="distribution-karaf-${TIMESTAMP}.zip" + ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}" else + ACTUALBUNDLEURL="${BUNDLEURL}" BUNDLE="${BUNDLEURL##*/}" BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))" - BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}" + BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}" fi -echo "Distribution bundle URL is ${BUNDLEURL}" +echo "Distribution bundle URL is ${ACTUALBUNDLEURL}" echo "Distribution bundle is ${BUNDLE}" +echo "Distribution bundle version is ${BUNDLEVERSION}" echo "Distribution folder is ${BUNDLEFOLDER}" +echo "Nexus prefix is ${NEXUSURL_PREFIX}" echo "Downloading the distribution..." -wget --no-verbose ${BUNDLEURL} +wget --no-verbose ${ACTUALBUNDLEURL} echo "Extracting the new controller..." unzip -q ${BUNDLE} echo "Configuring the startup features..." -cd ${BUNDLEFOLDER}/etc -CFG=org.apache.karaf.features.cfg -cp ${CFG} ${CFG}.bak -cat ${CFG}.bak | sed "s/^featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${CONTROLLERFEATURES}/" > ${CFG}.1 -cat ${CFG}.1 | sed "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%" > ${CFG} -cat ${CFG} +FEATURESCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg +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} +cat ${FEATURESCONF} echo "Configuring the log..." -LOG=org.ops4j.pax.logging.cfg -cp ${LOG} ${LOG}.bak -cat ${LOG}.bak | sed 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/' > ${LOG} -cat ${LOG} +LOGCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg +sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/g' ${LOGCONF} +cat ${LOGCONF} echo "Configure the repos..." -REPO=org.ops4j.pax.url.mvn.cfg -cp ${REPO} ${REPO}.bak -cat ${REPO}.bak | sed '/http/d' | sed '$s/...$//'> ${REPO} -cat ${REPO} +REPOCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.url.mvn.cfg +sed -ie '/http/d' ${REPOCONF} +sed -ie '$s/...$//' ${REPOCONF} +cat ${REPOCONF} echo "Configure max memory..." -MEM=setenv -cd ../bin -cp ${MEM} ${MEM}.bak -cat ${MEM}.bak | sed 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/' > ${MEM} -cat ${MEM} +MEMCONF=${WORKSPACE}/${BUNDLEFOLDER}/bin/setenv +sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' ${MEMCONF} +cat ${MEMCONF} echo "Starting controller..." -./start & +${WORKSPACE}/${BUNDLEFOLDER}/bin/start -echo "sleeping for 20 seconds..." -sleep 20 +echo "sleeping for 10 seconds..." +sleep 10 echo "Check OSGi bundles..." -sshpass -p karaf ./client -u karaf "feature:install ${CONTROLLERFEATURES}" || echo $? > ${WORKSPACE}/error.txt +sshpass -p karaf ${WORKSPACE}/${BUNDLEFOLDER}/bin/client -u karaf "feature:install ${ACTUALFEATURES}" || echo $? > ${WORKSPACE}/error.txt echo "Fetching Karaf log" -cd ${WORKSPACE} -cp ${BUNDLEFOLDER}/data/log/karaf.log . +cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log . echo "Exit with error" if [ `cat error.txt` -ne 0 ]; then