forked from form3tech-oss/platform-interview
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
50 lines (43 loc) · 1.61 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# Tells us if the host system is an Apple Silicon Mac running Rosetta
def running_rosetta()
!`sysctl -in sysctl.proc_translated`.strip().to_i.zero?
end
arch = `arch`.strip()
if arch == 'arm64' || (arch == 'i386' && running_rosetta()) # is M1
config.vm.box = "multipass"
else # not M1
config.vm.box = "ubuntu/bionic64"
end
config.vm.provider "multipass" do |multipass, override|
multipass.hd_size = "10G"
multipass.cpu_count = 1
multipass.memory_mb = 2048
multipass.image_name = "bionic"
end
config.vm.provision "file", source: "./form3.crt", destination: "/tmp/form3.crt"
config.vm.provision :shell,
keep_color: true,
privileged: false,
run: "always",
inline: <<-SCRIPT
sudo mv /tmp/form3.crt /usr/local/share/ca-certificates/form3_ca.crt
sudo update-ca-certificates
sudo ip link set dev $(ip a|grep -E "^[0-9]*:" | grep -v LOOPBACK|awk -F: '{print $2}' |grep -v docker) mtu 1024
SCRIPT
config.vm.provision :docker
config.vm.define "interview"
config.vm.hostname = "interview"
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/"
config.vm.provision :shell,
keep_color: true,
privileged: false,
run: "always",
path: "./run.sh"
end