Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Only try to destroy vagrant vm when one is running
Browse files Browse the repository at this point in the history
Signed-off-by: Kris Hicks <[email protected]>
  • Loading branch information
Andrei Dinin authored and krishicks committed Sep 3, 2014
1 parent 16ca8e5 commit 2269213
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ci/ci-box-bats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ trap cleanup EXIT

echo $CANDIDATE_BUILD_NUMBER

vagrant destroy local -f
running_virtualbox_vm_pid=`ps x | grep bosh-lite | grep startvm | cut -d ' ' -f2`
running_vmware_vm_pid=`ps x | grep bosh-lite | grep vmware-vmx | cut -d ' ' -f2`
if [ ! -n "$running_virtualbox_vm_pid" ] || [ ! -n "$running_vmware_vm_pid" ]; then
vagrant destroy local -f
fi

rm -rf /var/lib/jenkins/.bosh_cache/* || true

vagrant box add bosh-lite-${BOX_TYPE}-ubuntu-trusty-${CANDIDATE_BUILD_NUMBER}.box --name bosh-lite-ubuntu-trusty --force
Expand Down

0 comments on commit 2269213

Please sign in to comment.