vagrant/test/vagrant-spec/.runner-vmware.sh

48 lines
630 B
Bash
Raw Normal View History

2018-03-08 20:11:22 +00:00
#!/usr/bin/env bash
function cleanup {
vagrant destroy --force
}
trap cleanup EXIT
GEM_PATH=$(ls vagrant-spec*.gem)
set -ex
if [ -f "${GEM_PATH}" ]
then
mv "${GEM_PATH}" vagrant-spec.gem
fi
2018-06-19 16:57:03 +00:00
vagrant box update
vagrant box prune
2018-03-08 20:11:22 +00:00
guests=$(vagrant status | grep vmware | awk '{print $1}')
vagrant up --no-provision
declare -A pids
for guest in ${guests}
do
vagrant provision ${guest} &
2018-09-11 22:07:21 +00:00
pids[$guest]=$!
2018-03-08 20:11:22 +00:00
sleep 60
done
result=0
set +e
for guest in ${guests}
do
2018-09-11 22:07:21 +00:00
wait ${pids[$guest]}
2018-03-08 20:11:22 +00:00
if [ $? -ne 0 ]
then
echo "Provision failure for: ${guest}"
result=1
fi
done
exit $result