compass: Adjust jjb and scripts 55/9355/1
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Fri, 5 Feb 2016 07:43:50 +0000 (08:43 +0100)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Fri, 5 Feb 2016 07:43:50 +0000 (08:43 +0100)
- Checkout the commit that was used for building the ISO to have consistency
- Switch to include-raw-escape and get rid of extra/escape curly brackets

Change-Id: I8f879b39d310ac14d72f77e260c7e80e0bf33e39
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/compass4nfv/compass-ci-jobs.yml
jjb/compass4nfv/compass-deploy.sh
jjb/compass4nfv/compass-project-jobs.yml

index a4be24e..b0556d0 100644 (file)
 
     builders:
         - shell:
-            !include-raw: ./compass-workspace-precleanup.sh
+            !include-raw-escape: ./compass-workspace-precleanup.sh
         - shell:
-            !include-raw: ./compass-download-artifact.sh
+            !include-raw-escape: ./compass-download-artifact.sh
         - shell:
-            !include-raw: ./compass-deploy.sh
+            !include-raw-escape: ./compass-deploy.sh
 
     publishers:
         - archive:
index 697a1d5..860f5da 100644 (file)
@@ -6,24 +6,38 @@ echo "Starting the deployment on baremetal environment using $INSTALLER_TYPE. Th
 echo "--------------------------------------------------------"
 echo
 
+# source the properties file so we get OPNFV vars
+source $BUILD_DIRECTORY/latest.properties
+
+# echo the info about artifact that is used during the deployment
+echo "Using ${OPNFV_ARTIFACT_URL/*\/} for deployment"
+
+if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
+    # for none-merge deployments
+    # checkout the commit that was used for building the downloaded artifact
+    # to make sure the ISO and deployment mechanism uses same versions
+    echo "Checking out $OPNFV_GIT_SHA1"
+    git checkout $OPNFV_GIT_SHA1 --quiet
+fi
+
 echo 1 > /proc/sys/vm/drop_caches
 
 export CONFDIR=$WORKSPACE/deploy/conf
 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
 if [[ "$NODE_NAME" =~ "-vm" ]]; then
     export NETWORK_CONF=$CONFDIR/vm_environment/$NODE_NAME/network.yml
-    export DHA_CONF=$CONFDIR/vm_environment/${{DEPLOY_SCENARIO}}.yml
+    export DHA_CONF=$CONFDIR/vm_environment/${DEPLOY_SCENARIO}.yml
 else
     export INSTALL_NIC=eth1
     export NETWORK_CONF=$CONFDIR/hardware_environment/$NODE_NAME/network.yml
-    export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${{DEPLOY_SCENARIO}}.yml
+    export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${DEPLOY_SCENARIO}.yml
 fi
 
 cd $WORKSPACE
 
-export OS_VERSION=${{COMPASS_OS_VERSION}}
-export OPENSTACK_VERSION=${{COMPASS_OPENSTACK_VERSION}}
-./deploy.sh --dha ${{DHA_CONF}} --network ${{NETWORK_CONF}}
+export OS_VERSION=${COMPASS_OS_VERSION}
+export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
+./deploy.sh --dha ${DHA_CONF} --network ${NETWORK_CONF}
 if [ $? -ne 0 ]; then
     echo "depolyment failed!"
     deploy_ret=1
@@ -34,6 +48,6 @@ echo "--------------------------------------------------------"
 echo "Done!"
 
 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
-sshpass -p root scp 2>/dev/null $ssh_options root@${{INSTALLER_IP}}:/var/ansible/run/openstack_${{COMPASS_OPENSTACK_VERSION}}-opnfv2/ansible.log ./  &> /dev/null
+sshpass -p root scp 2>/dev/null $ssh_options root@${INSTALLER_IP}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./  &> /dev/null
 
 exit $deploy_ret
index 8943afb..11e1d5f 100644 (file)
 
     builders:
         - shell:
-            !include-raw: ./compass-build.sh
+            !include-raw-escape: ./compass-build.sh
         - shell:
-            !include-raw: ./compass-deploy.sh
+            !include-raw-escape: ./compass-deploy.sh
 
     publishers:
         - archive:
 
     builders:
         - shell:
-            !include-raw: ./compass-build.sh
+            !include-raw-escape: ./compass-build.sh
         - shell:
-            !include-raw: ./compass-upload-artifact.sh
+            !include-raw-escape: ./compass-upload-artifact.sh
         - shell:
-            !include-raw: ./compass-workspace-cleanup.sh
+            !include-raw-escape: ./compass-workspace-cleanup.sh
 
 - job-template:
     name: 'compass-build-ppa-{stream}'
 
     builders:
         - shell:
-            !include-raw: ./compass-makeppa.sh
+            !include-raw-escape: ./compass-makeppa.sh