jjb: xci: Add postbuild publisher script to remove clean VM
[releng.git] / jjb / xci / xci-cleanup.sh
index ce84830..51a863d 100755 (executable)
 # what you are doing.
 #----------------------------------------------------------------------
 
+# Need to cover macros with and without parameters
+VM_NAME=$DISTRO
+VM_NAME+=_xci_vm
+
 # skip the deployment if the patch doesn't impact the deployment
 if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
     echo "Skipping the deployment!"
     exit 0
 fi
 
-sudo virsh destroy ${DISTRO}_xci_vm || true
-sudo virsh undefine ${DISTRO}_xci_vm || true
+sudo virsh destroy $VM_NAME || true
+sudo virsh undefine $VM_NAME || true