This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Vagrantfile
74 lines (61 loc) · 3.44 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Unfortunately need to require a very recent version due to
# issues caused by default Vagrant box hosting moving to
# vagrantcloud.com
# See https://github.com/hashicorp/vagrant/issues/9442
Vagrant.require_version ">= 2.0.3"
# 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|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Set up the quickstart environment on 20.04 LTS Ubuntu
config.vm.box = "bento/ubuntu-20.04"
# Optionally cache packages
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
# Port forwarding
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
config.vm.network "forwarded_port", guest: 4200, host: 4200, auto_correct: true
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.network "forwarded_port", guest: 7050, host: 7050, auto_correct: true
config.vm.network "forwarded_port", guest: 7051, host: 7051, auto_correct: true
config.vm.network "forwarded_port", guest: 7052, host: 7052, auto_correct: true
config.vm.network "forwarded_port", guest: 7054, host: 7054, auto_correct: true
config.vm.network "forwarded_port", guest: 7055, host: 7055, auto_correct: true
config.vm.network "forwarded_port", guest: 7056, host: 7056, auto_correct: true
config.vm.network "forwarded_port", guest: 9051, host: 9051, auto_correct: true
config.vm.network "forwarded_port", guest: 9052, host: 9052, auto_correct: true
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
#config.vm.synced_folder "go/src", "/home/vagrant/go/src", create: true
# VirtualBox configuration
config.vm.provider "virtualbox" do |vb|
# Increase memory allocated to vm (for build tasks)
vb.memory = 6192
# Add disk space
disk = File.join(File.realpath(File.expand_path(__dir__)), "fabric-devenv-disk.vmdk").to_s
if not File.exists?(disk)
vb.customize [ "createmedium", "disk", "--filename", disk, "--format", "vmdk", "--size", 1024 * 20 ]
vb.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", 1, "--device", 0, "--type", "hdd", "--medium", disk]
end
end
# Configure additional disk space
config.vm.provision "provision-disk", type: "shell", path: "provision-disk.sh", privileged: true
# Configure vagrant user .profile
config.vm.provision "provision-user-profile", type: "shell", path: "provision-user-profile.sh", privileged: false
# Install required software
config.vm.provision "provision-root", type: "shell", path: "provision-root.sh", privileged: true, args: ENV['HLF_VERSION']
config.vm.provision "provision-user", type: "shell", path: "provision-user.sh", privileged: false, args: ENV['HLF_VERSION']
end