diff --git a/.gitignore b/.gitignore index fa9ae8f67..be2f23371 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ bin/ coverage.txt -.DS_Store \ No newline at end of file +.DS_Store +.vagrant \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..f56537fa7 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,100 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Copyright The reignite Authors + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/focal64" + + config.ssh.forward_agent = true + + config.vm.provider :virtualbox do |v| + # Enable nested virtualisation in VBox + v.customize ["modifyvm", :id, "--nested-hw-virt", "on"] + + v.memory = 4096 + v.cpus = 2 + end + + config.vm.provision "upgrade-packages", type: "shell", run: "once" do |sh| + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eux -o pipefail + apt update && apt upgrade -y + SHELL + end + + config.vm.provision "install-basic-packages", type: "shell", run: "once" do |sh| + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eux -o pipefail + apt install -y \ + make \ + git \ + gcc \ + curl \ + unzip \ + containerd + SHELL + end + + config.vm.provision "install-golang", type: "shell", run: "once" do |sh| + sh.env = { + 'GO_VERSION': ENV['GO_VERSION'] || "1.17.1", + } + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eux -o pipefail + curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local + cat >> /etc/environment <> /etc/profile.d/sh.local <