buildserver: move config to buildserver/Vagrantfile.yaml

This commit is contained in:
Hans-Christoph Steiner 2022-10-19 11:31:38 +02:00
parent e2fcd633fc
commit abf535aabe
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
3 changed files with 44 additions and 40 deletions

View file

@ -1,13 +1,22 @@
require 'yaml'
require 'pathname'
configfile = {
'boot_timeout' => 600,
'cachedir' => File.join(ENV['HOME'], '.cache', 'fdroidserver'),
'cpus' => 1,
'debian_mirror' => 'https://deb.debian.org/debian/',
'hwvirtex' => 'on',
'memory' => 2048,
'vm_provider' => 'virtualbox',
}
srvpath = Pathname.new(File.dirname(__FILE__)).realpath
configpath = File.join(srvpath, "/Vagrantfile.yaml")
if File.exists? configpath
configfile = YAML.load_file(configpath)
else
puts "#{configpath} does not exist, run ./makebuildserver?"
configfile = Hash.new
YAML.load_file(configpath).each do |k,v|
configfile[k] = v
end
end
Vagrant.configure("2") do |config|
@ -62,12 +71,9 @@ Vagrant.configure("2") do |config|
args: [configfile["aptproxy"]]
end
# buildserver/ is shared to the VM's /vagrant by default so the old
# default does not need a custom mount
if configfile["cachedir"] != "buildserver/cache"
config.vm.synced_folder configfile["cachedir"], '/vagrant/cache',
create: true, type: synced_folder_type
end
config.vm.synced_folder configfile["cachedir"], '/vagrant/cache',
create: true, type: synced_folder_type
# Make sure dir exists to mount to, since buildserver/ is
# automatically mounted as /vagrant in the guest VM. This is more
# necessary with 9p synced folders