1# NOTE: This is not a public image. It's only available within the Elastic
2# organization and requires a 'vagrant login'.
3
4GO_VERSION = "1.12.4"
5
6# Provisioning for Windows PowerShell.
7$winPsProvision = <<SCRIPT
8echo "Installing gvm to manage go version"
9[Net.ServicePointManager]::SecurityProtocol = "tls12"
10Invoke-WebRequest -URI https://github.com/andrewkroh/gvm/releases/download/v0.2.0/gvm-windows-amd64.exe -Outfile C:\Windows\System32\gvm.exe
11C:\Windows\System32\gvm.exe --format=powershell #{GO_VERSION} | Invoke-Expression
12go version
13
14echo "Configure environment variables"
15[System.Environment]::SetEnvironmentVariable("GOROOT", "C:\\Users\\vagrant\\.gvm\\versions\\go#{GO_VERSION}.windows.amd64", [System.EnvironmentVariableTarget]::Machine)
16[System.Environment]::SetEnvironmentVariable("PATH", "$env:GOROOT\\bin;$env:PATH", [System.EnvironmentVariableTarget]::Machine)
17SCRIPT
18
19Vagrant.configure("2") do |config|
20  config.vm.box = "elastic/windows-2016-x86_64"
21
22  config.vm.provision "shell", inline: $winPsProvision
23
24  config.vm.provider "virtualbox" do |v|
25    v.memory = 4096
26  end
27end
28
29# -*- mode: ruby -*-
30# vi: set ft=ruby :
31