Switch the csit-1node to use job prefix
[releng/builder.git] / jjb / integration / integration-configure-clustering.sh
index fa7906ce3116863fb181384920dfe0bd71ec19e6..5b1db13ec908f13a2ccd58676d2918d611fe6c38 100644 (file)
@@ -9,21 +9,11 @@ echo "#################################################"
 echo "##         Configure Cluster and Start         ##"
 echo "#################################################"
 
-AKKACONF=/tmp/${BUNDLEFOLDER}/configuration/initial/akka.conf
-MODULESCONF=/tmp/${BUNDLEFOLDER}/configuration/initial/modules.conf
-MODULESHARDSCONF=/tmp/${BUNDLEFOLDER}/configuration/initial/module-shards.conf
-FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
-CUSTOMPROP=/tmp/${BUNDLEFOLDER}/etc/custom.properties
-LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
-MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
-CONTROLLERMEM="2048m"
-
-
 if [ ${CONTROLLERSCOPE} == 'all' ]; then
     ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
-    CONTROLLERMEM="3072m"
+    export CONTROLLERMEM="3072m"
 else
-    ACTUALFEATURES="${CONTROLLERFEATURES}"
+    ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}"
 fi
 # Some versions of jenkins job builder result in feature list containing spaces
 # and ending in newline. Remove all that.
@@ -75,9 +65,19 @@ wget --progress=dot:mega  '${ACTUAL_BUNDLE_URL}'
 echo "Extracting the new controller..."
 unzip -q ${BUNDLE}
 
+echo "Adding external repositories..."
+sed -ie "s%org.ops4j.pax.url.mvn.repositories=%org.ops4j.pax.url.mvn.repositories=http://repo1.maven.org/maven2@id=central, http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, http://zodiac.springsource.com/maven/bundles/release@id=gemini, http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases%g" ${MAVENCONF}
+cat ${MAVENCONF}
+
 echo "Configuring the startup features..."
 sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF}
-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,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.0.0/xml/features%g" ${FEATURESCONF}
+
+FEATURE_TEST_STRING="features-integration-test"
+if [[ "$KARAF_VERSION" == "karaf4" ]]; then
+    FEATURE_TEST_STRING="features-test"
+fi
+
+sed -ie "s%\(featuresRepositories=\|featuresRepositories =\)%featuresRepositories = mvn:org.opendaylight.integration/\${FEATURE_TEST_STRING}/${BUNDLEVERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.0.0/xml/features,%g" ${FEATURESCONF}
 cat ${FEATURESCONF}
 
 echo "Configuring the log..."
@@ -105,22 +105,7 @@ if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
   cat ${CUSTOMPROP}
 fi
 
-echo "Configure java home and max memory..."
-sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' ${MEMCONF}
-sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' ${MEMCONF}
-cat ${MEMCONF}
-
-echo "Set Java version"
-sudo /usr/sbin/alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 1
-sudo /usr/sbin/alternatives --set java ${JAVA_HOME}/bin/java
-echo "JDK default version ..."
-java -version
-
-echo "Set JAVA_HOME"
-export JAVA_HOME="${JAVA_HOME}"
-# Did you know that in HERE documents, single quote is an ordinary character, but backticks are still executing?
-JAVA_RESOLVED=\`readlink -e "\${JAVA_HOME}/bin/java"\`
-echo "Java binary pointed at by JAVA_HOME: \${JAVA_RESOLVED}"
+set_java_vars
 
 # Copy shard file if exists
 if [ -f /tmp/custom_shard_config.txt ]; then
@@ -148,6 +133,7 @@ cat > ${WORKSPACE}/startup-script.sh <<EOF
 
 echo "Redirecting karaf console output to karaf_console.log"
 export KARAF_REDIRECT="/tmp/${BUNDLEFOLDER}/data/log/karaf_console.log"
+mkdir -p /tmp/${BUNDLEFOLDER}/data/log
 
 echo "Starting controller..."
 /tmp/${BUNDLEFOLDER}/bin/start