2017-02-01 00:45:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
export PKG='github.com/containers/storage'
|
|
|
|
export VAGRANT_MACHINES="fedora debian"
|
|
|
|
if test -z "$VAGRANT_PROVIDER" ; then
|
2017-03-28 19:56:09 +00:00
|
|
|
if lsmod | grep -q '^vboxdrv ' ; then
|
2017-02-01 00:45:59 +00:00
|
|
|
VAGRANT_PROVIDER=virtualbox
|
2017-03-28 19:56:09 +00:00
|
|
|
elif lsmod | grep -q '^kvm ' ; then
|
|
|
|
VAGRANT_PROVIDER=libvirt
|
2017-02-01 00:45:59 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
export VAGRANT_PROVIDER=${VAGRANT_PROVIDER:-libvirt}
|
|
|
|
export VAGRANT_PROVIDER=${VAGRANT_PROVIDER:-virtualbox}
|
|
|
|
if ${IN_VAGRANT_MACHINE:-false} ; then
|
|
|
|
unset AUTO_GOPATH
|
2017-03-28 19:56:09 +00:00
|
|
|
export GOPATH=/go
|
|
|
|
export PATH=${GOPATH}/bin:/go/src/${PKG}/vendor/src/github.com/golang/lint/golint:${PATH}
|
|
|
|
sudo modprobe aufs || true
|
|
|
|
sudo modprobe zfs || true
|
2017-02-01 00:45:59 +00:00
|
|
|
"$@"
|
|
|
|
else
|
|
|
|
vagrant up --provider ${VAGRANT_PROVIDER}
|
|
|
|
for machine in ${VAGRANT_MACHINES} ; do
|
|
|
|
vagrant reload ${machine}
|
|
|
|
vagrant ssh ${machine} -c "cd /go/src/${PKG}; IN_VAGRANT_MACHINE=true sudo -E $0 $*"
|
|
|
|
vagrant ssh ${machine} -c "sudo poweroff &"
|
|
|
|
done
|
|
|
|
fi
|