Make jobs karaf-version specific, some duplicities
[releng/builder.git] / jjb / neutron / include-raw-openstack-ci.sh
index 272149fa960c9cedb0b77769d680461514d9d663..24d43322e7b47ec523be182017ef064b1ed5ae54 100644 (file)
@@ -17,18 +17,18 @@ sudo chown -R jenkins:jenkins /opt/stack/new
 sudo bash -c 'echo "stack ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers'
 
 # We need to install some scripts from openstack-infra/project-config
-cd ~
+cd ~ || exit 1
 echo "Setting up infra scripts"
 sudo mkdir -p /usr/local/jenkins/slave_scripts
 git clone https://git.openstack.org/openstack-infra/project-config
-cd project-config
+cd project-config || exit 1
 sudo cp jenkins/scripts/subunit2html.py /usr/local/jenkins/slave_scripts
 
 # Save existing WORKSPACE
 SAVED_WORKSPACE=$WORKSPACE
 export WORKSPACE=~/workspace
 mkdir -p $WORKSPACE
-cd $WORKSPACE
+cd $WORKSPACE || exit 1
 
 # This is the job which checks out devstack-gate
 if [[ ! -e devstack-gate ]]; then
@@ -36,7 +36,7 @@ if [[ ! -e devstack-gate ]]; then
     git clone https://git.openstack.org/openstack-infra/devstack-gate
 else
     echo "Fixing devstack-gate git remotes"
-    cd devstack-gate
+    cd devstack-gate || exit 1
     git remote set-url origin https://git.openstack.org/openstack-infra/devstack-gate
     git remote update
     git reset --hard
@@ -55,11 +55,11 @@ fi
 
 # Set the pieces we want to test
 if [ "$GERRIT_PROJECT" == "openstack/neutron" ]; then
-    ZUUL_PROJECT=$GERRIT_PROJECT
-    ZUUL_BRANCH=$GERRIT_REFSPEC
+    export ZUUL_PROJECT=$GERRIT_PROJECT
+    export ZUUL_BRANCH=$GERRIT_REFSPEC
 elif [ "$GERRIT_PROJECT" == "openstack-dev/devstack" ]; then
-    ZUUL_PROJECT=$GERRIT_PROJECT
-    ZUUL_BRANCH=$GERRIT_REFSPEC
+    export ZUUL_PROJECT=$GERRIT_PROJECT
+    export ZUUL_BRANCH=$GERRIT_REFSPEC
 fi
 
 echo "Setting environment variables"
@@ -72,7 +72,7 @@ DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MAX_MEM=784m;"
 DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MAX_PERM_MEM=784m;"
 
 # Set ODL_URL_PREFIX if "nexus proxy" is provided
-URL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+export URL_PREFIX="${ODLNEXUSPROXY:-https://nexus.opendaylight.org}"
 if [ -n "$ODLNEXUSPROXY" ] ; then
     DEVSTACK_LOCAL_CONFIG+="ODL_URL_PREFIX=$ODLNEXUSPROXY;"
 fi
@@ -80,19 +80,10 @@ fi
 ## # Trim down the boot wait time
 ## export ODL_BOOT_WAIT=30
 
-# Use Lithium build, if asked to do so
+# Use specific build, if asked to do so
 if [ "${ODL_VERSION}" == "lithium-latest" ] ; then
-    NEXUSPATH="${URL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf"
-    BUNDLEVERSION='0.3.0-SNAPSHOT'
-
-    # Acquire the timestamp information from maven-metadata.xml
-    wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
-    BUNDLE_TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
-    echo "Nexus timestamp is ${BUNDLE_TIMESTAMP}"
-
-    DEVSTACK_LOCAL_CONFIG+="ODL_NAME=distribution-karaf-${BUNDLEVERSION};"
-    DEVSTACK_LOCAL_CONFIG+="ODL_PKG=distribution-karaf-${BUNDLE_TIMESTAMP}.zip;"
-    DEVSTACK_LOCAL_CONFIG+="ODL_URL=${NEXUSPATH}/${BUNDLEVERSION};"
+    # FIXME: Support more recent ODL release versions.
+    DEVSTACK_LOCAL_CONFIG+="ODL_RELEASE=lithium-snapshot;"
 fi
 
 # If Karaf netvirt feature was explicitly provided, add it to DEVSTACK_LOCAL_CONFIG
@@ -112,14 +103,14 @@ fi
 # Because we are testing a non standard project, add
 # our project repository. This makes zuul do the right
 # reference magic for testing changes.
-export PROJECTS="stackforge/networking-odl $PROJECTS"
+export PROJECTS="openstack/networking-odl $PROJECTS"
 # Note the actual url here is somewhat irrelevant because it
 # caches in nodepool, however make it a valid url for
 # documentation purposes.
-if [ "$GERRIT_PROJECT" == "stackforge/networking-odl" ]; then
+if [ "$GERRIT_PROJECT" == "openstack/networking-odl" ]; then
     export DEVSTACK_LOCAL_CONFIG+="enable_plugin networking-odl https://$GERRIT_HOST/$GERRIT_PROJECT $GERRIT_REFSPEC"
 else
-    export DEVSTACK_LOCAL_CONFIG+="enable_plugin networking-odl https://git.openstack.org/stackforge/networking-odl"
+    export DEVSTACK_LOCAL_CONFIG+="enable_plugin networking-odl https://git.openstack.org/openstack/networking-odl"
 fi
 
 
@@ -147,11 +138,11 @@ OS_WORKSPACE=$WORKSPACE
 export WORKSPACE=$SAVED_WORKSPACE
 
 # Copy all the logs
-cp -r $OS_WORKSPACE/logs $WORKSPACE
-cp -a /opt/stack/new/logs/q-odl-karaf* $WORKSPACE/logs
-mkdir -p $WORKSPACE/logs/opendaylight
-cp -a /opt/stack/new/opendaylight/distribution*/etc $WORKSPACE/logs/opendaylight
+cp -r "$OS_WORKSPACE/logs" "$WORKSPACE"
+cp -a /opt/stack/new/logs/q-odl-karaf* "$WORKSPACE/logs"
+mkdir -p "$WORKSPACE/logs/opendaylight"
+cp -a /opt/stack/new/opendaylight/distribution*/etc "$WORKSPACE/logs/opendaylight"
 # Unzip the logs to make them easier to view
-gunzip $WORKSPACE/logs/*.gz
+gunzip "$WORKSPACE"/logs/*.gz
 
 exit $DGRET