1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

makebuildserver: allow a list/tuple for baseboxurl to support local copy

config.vm.box_url can be a list/tuple of URLs, which is useful to specific
a locally cached copy.  This is needed on slow connections, so that if it
fails, the download of jessie32.box does not have to start from the
beginning of the file again.
This commit is contained in:
Hans-Christoph Steiner 2015-08-26 12:23:41 +02:00
parent 99d0c55fe9
commit 4b0a6ed29f
2 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,8 @@ basebox = "jessie32"
# in a secure environment using trusted media (see the manual) but # in a secure environment using trusted media (see the manual) but
# you can use this default if you like... # you can use this default if you like...
baseboxurl = "https://f-droid.org/jessie32.box" baseboxurl = "https://f-droid.org/jessie32.box"
# or if you have a cached local copy, you can use that first:
# baseboxurl = ["file:///home/fdroid/fdroidserver/cache/jessie32.box", "https://f-droid.org/jessie32.box"]
# The amount of RAM the build server will have # The amount of RAM the build server will have
memory = 3584 memory = 3584

View File

@ -164,6 +164,11 @@ for f, src, shasum in cachefiles:
wanted.append(f) wanted.append(f)
# allow specifying a list/tuple that includes cached local copy
if type(config['baseboxurl']) in (list, tuple) or config['baseboxurl'][0] in ('(', '['):
baseboxurl = config['baseboxurl']
else:
baseboxurl = '"{0}"'.format(config['baseboxurl'])
# Generate an appropriate Vagrantfile for the buildserver, based on our # Generate an appropriate Vagrantfile for the buildserver, based on our
# settings... # settings...
@ -178,7 +183,7 @@ Vagrant.configure("2") do |config|
end end
config.vm.box = "{0}" config.vm.box = "{0}"
config.vm.box_url = "{1}" config.vm.box_url = {1}
config.vm.provider "virtualbox" do |v| config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "{2}"] v.customize ["modifyvm", :id, "--memory", "{2}"]
@ -187,7 +192,7 @@ Vagrant.configure("2") do |config|
config.vm.provision :shell, :path => "fixpaths.sh" config.vm.provision :shell, :path => "fixpaths.sh"
""".format(config['basebox'], """.format(config['basebox'],
config['baseboxurl'], baseboxurl,
config['memory'], config['memory'],
config.get('cpus', 1)) config.get('cpus', 1))
if 'aptproxy' in config and config['aptproxy']: if 'aptproxy' in config and config['aptproxy']: