Vagrantfile 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. GOVERSION = "1.17.8"
  2. Vagrant.configure("2") do |config|
  3. config.vm.define "ubuntu" do |ubuntu|
  4. ubuntu.vm.box = "generic/ubuntu2004"
  5. end
  6. config.vm.define "freebsd" do |freebsd|
  7. freebsd.vm.box = "generic/freebsd13"
  8. end
  9. config.ssh.forward_agent = true
  10. config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/mistifyio/go-zfs", create: true
  11. config.vm.provision "shell", inline: <<-EOF
  12. set -euxo pipefail
  13. os=$(uname -s|tr '[A-Z]' '[a-z]')
  14. case $os in
  15. linux) apt-get update -y && apt-get install -y --no-install-recommends gcc libc-dev zfsutils-linux ;;
  16. esac
  17. cd /tmp
  18. curl -fLO --retry-max-time 30 --retry 10 https://go.dev/dl/go#{GOVERSION}.$os-amd64.tar.gz
  19. tar -C /usr/local -zxf go#{GOVERSION}.$os-amd64.tar.gz
  20. ln -nsf /usr/local/go/bin/go /usr/local/bin/go
  21. rm -rf go*.tar.gz
  22. chown -R vagrant:vagrant /home/vagrant/go
  23. cd /home/vagrant/go/src/github.com/mistifyio/go-zfs
  24. go test -c
  25. sudo ./go-zfs.test -test.v
  26. CGO_ENABLED=0 go test -c
  27. sudo ./go-zfs.test -test.v
  28. EOF
  29. end