1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-24 08:46:24 -07:00
gochan/vagrant/Vagrantfile

36 lines
991 B
Text
Raw Normal View History

2017-08-12 01:17:26 -07:00
# -*- mode: ruby -*-
# vi: set ft=ruby :
DBTYPE = ENV.fetch("GC_DBTYPE", "mysql")
if DBTYPE != "mysql" && DBTYPE != "postgresql"
puts "Invalid GC_DBTYPE environment variable, must be mysql or postgresql, got #{DBTYPE}"
abort
end
2017-08-12 01:17:26 -07:00
PROVIDER = ENV.fetch("GC_PROVIDER", "virtualbox") # can be virtualbox or libvirt
BOX = "generic/ubuntu1604"
if PROVIDER == "virtualbox"
BOX = "ubuntu/xenial64"
end
2017-08-12 01:17:26 -07:00
Vagrant.configure("2") do |config|
config.ssh.username = "vagrant"
config.vm.box = BOX
config.vm.network "forwarded_port", guest: 80, host: 80
2017-08-12 01:17:26 -07:00
config.vm.network :private_network, ip: "172.27.0.3"
config.vm.synced_folder "../", "/vagrant"
config.vm.provider PROVIDER do |provider|
if PROVIDER == "virtualbox"
provider.gui = false
end
provider.cpus = "4"
provider.memory = "4096"
2017-08-12 01:17:26 -07:00
end
2019-08-01 21:05:06 -07:00
config.vm.provision :shell, path: "bootstrap.sh", env: {
2019-11-24 14:42:39 -08:00
:DBTYPE => DBTYPE,
:GOPATH => "/home/vagrant/go",
2019-11-24 14:42:39 -08:00
:FROMDOCKER => ""
2019-08-01 21:05:06 -07:00
}, args: "install"
2017-08-12 01:17:26 -07:00
end