forked from libretime/libretime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
86 lines (74 loc) · 3.15 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
75
76
77
78
79
80
81
82
83
84
85
86
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# libretime web interface
config.vm.network "forwarded_port", guest: 8080, host:8080
# icecast2
config.vm.network "forwarded_port", guest: 8000, host:8000
# liquidsoap input harbors for instreaming (ie. /master)
config.vm.network "forwarded_port", guest: 8001, host:8001
config.vm.network "forwarded_port", guest: 8002, host:8002
# mkdocs documentation
config.vm.network "forwarded_port", guest: 8888, host:8888
# make sure we are using nfs (doesn't work out of the box with debian)
config.vm.synced_folder ".", "/vagrant", type: "nfs"
# private network for nfs
config.vm.network "private_network", ip: "192.168.10.100"
config.vm.provider "virtualbox" do |v|
# to run without OOMing we need at least 1GB of RAM
v.memory = 1024
# enable audio drivers on VM settings
# pinched from https://github.com/GeoffreyPlitt/vagrant-audio
config.vm.provider :virtualbox do |vb|
if RUBY_PLATFORM =~ /darwin/
vb.customize ["modifyvm", :id, '--audio', 'coreaudio', '--audiocontroller', 'hda'] # choices: hda sb16 ac97
elsif RUBY_PLATFORM =~ /mingw|mswin|bccwin|cygwin|emx/
vb.customize ["modifyvm", :id, '--audio', 'dsound', '--audiocontroller', 'ac97']
end
end
end
# default installer args used for all distros
installer_args="--force --in-place --verbose --postgres --apache --icecast "
# define all the OS boxes we support
config.vm.define "ubuntu-xenial" do |os|
os.vm.box = "bento/ubuntu-16.04"
provision_libretime(os, "ubuntu.sh", installer_args)
end
config.vm.define "ubuntu-trusty" do |os|
os.vm.box = "bento/ubuntu-14.04"
provision_libretime(os, "ubuntu.sh", installer_args)
end
config.vm.define "ubuntu" do |os|
STDERR.puts 'WARNING: The "ubuntu" option is deprecated. Please migrate to "ubuntu-trusty".'
STDERR.puts
os.vm.box = "ubuntu/trusty64"
provision_libretime(os, "ubuntu.sh", installer_args)
end
config.vm.define "debian-jessie" do |os|
os.vm.box = "bento/debian-8.7"
provision_libretime(os, "debian.sh", installer_args)
end
config.vm.define "debian-wheezy" do |os|
os.vm.box = "bento/debian-7.11"
provision_libretime(os, "debian.sh", installer_args)
end
config.vm.define "debian" do |os|
STDERR.puts 'WARNING: The "debian" option is deprecated. Please migrate to "debian-jessie".'
STDERR.puts
os.vm.box = "debian/jessie64"
provision_libretime(os, "debian.sh", installer_args)
end
config.vm.define "centos" do |os|
os.vm.box = 'centos/7'
provision_libretime(os, "centos.sh", installer_args + "--selinux")
end
def provision_libretime(config, prepare_script, installer_args)
# Prepare OS
config.vm.provision "prepare", type: "shell", path: "installer/vagrant/%s" % prepare_script
# Provision LibreTime
config.vm.provision "install", type: "shell", inline: "cd /vagrant; ./install %s --web-port=8080" % installer_args
# Provision docs
config.vm.provision "install-mkdocs", type: "shell", path: "docs/scripts/install.sh"
config.vm.provision "start-mkdocs", type: "shell", path: "docs/scripts/serve.sh"
end
end