-
Notifications
You must be signed in to change notification settings - Fork 20
/
Vagrantfile
executable file
·37 lines (33 loc) · 1.13 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
DBTYPE = ENV.fetch("GC_DBTYPE", "mysql")
if DBTYPE != "mysql" && DBTYPE != "postgresql" && DBTYPE != "sqlite3"
puts "Invalid GC_DBTYPE environment variable set in the host, must be mysql, postgresql, or sqlite3, got #{DBTYPE}"
abort
end
PROVIDER = ENV.fetch("GC_PROVIDER", "virtualbox") # can be virtualbox or libvirt
BOX = "generic/ubuntu2004"
if PROVIDER == "virtualbox"
BOX = "ubuntu/focal64"
end
Vagrant.configure("2") do |config|
config.ssh.username = "vagrant"
config.vm.box = BOX
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 443, host: 4430
config.vm.network :private_network, ip: "192.168.56.3"
config.vm.synced_folder "../", "/vagrant"
config.vm.provider PROVIDER do |provider|
if PROVIDER == "virtualbox"
provider.gui = false
end
provider.cpus = "4"
provider.memory = "2048"
end
config.vm.provision :shell, path: "bootstrap.sh", env: {
:DBTYPE => DBTYPE,
:GOPATH => "/home/vagrant/go",
:MYSQL_MAINLINE => ENV.fetch("GC_MYSQL_MAINLINE", ""),
:FROMDOCKER => ""
}, args: "install"
end