switch to fdroid-stretch64 basebox; remove baseboxurl form makebuildserver

This commit is contained in:
Michael Pöhn 2018-07-28 16:48:15 +02:00 committed by Michael Pöhn
parent c005d8c5f4
commit 5e4eb294c5
2 changed files with 22 additions and 33 deletions

View file

@ -3,16 +3,7 @@
# You may want to alter these before running ./makebuildserver # You may want to alter these before running ./makebuildserver
# Name of the base box to use # Name of the base box to use
# basebox = "jessie64" # basebox = "fdroid-stretch64"
# Location where testing32.box can be found, if you don't already have
# it. For security reasons, it's recommended that you make your own
# in a secure environment using trusted media (see the manual) but
# you can use this default if you like...
# baseboxurl = "https://f-droid.org/jessie64.box"
#
# or if you have a cached local copy, you can use that first:
# baseboxurl = ["file:///home/fdroid/fdroidserver/cache/jessie64.box", "https://f-droid.org/jessie64.box"]
# In the process of setting up the build server, many gigs of files # In the process of setting up the build server, many gigs of files
# are downloaded (Android SDK components, gradle, etc). These are # are downloaded (Android SDK components, gradle, etc). These are

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import pathlib
import re import re
import requests import requests
import stat import stat
@ -56,10 +55,7 @@ cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver')
logger.debug('cachedir set to: %s', cachedir) logger.debug('cachedir set to: %s', cachedir)
config = { config = {
'basebox': 'jessie64', 'basebox': 'fdroid-stretch64',
'baseboxurl': [
pathlib.Path(os.path.join(cachedir, 'jessie64.box')).as_uri()
],
'debian_mirror': 'http://http.debian.net/debian/', 'debian_mirror': 'http://http.debian.net/debian/',
'apt_package_cache': False, 'apt_package_cache': False,
'copy_caches_from_host': False, 'copy_caches_from_host': False,
@ -535,23 +531,25 @@ def main():
with open(vf, 'w', encoding='utf-8') as f: with open(vf, 'w', encoding='utf-8') as f:
yaml.dump(config, f) yaml.dump(config, f)
if config['vm_provider'] == 'libvirt': # Check if selected provider is supported
available_providers = [x.provider for x in v.box_list() if x.name == config['basebox']] if config['vm_provider'] not in ['libvirt', 'virtualbox']:
found_basebox = len(available_providers) > 0 logger.critical("Currently selected VM provider '{vm_provider}' "
needs_mutate = 'libvirt' not in available_providers "is not supported. (please choose from: "
if not found_basebox: "virtualbox, libvirt)"
if isinstance(config['baseboxurl'], str): .format(vm_provider=config['cm_provider']))
baseboxurl = config['baseboxurl'] sys.exit(1)
else: # Check if selected basebox is available
baseboxurl = config['baseboxurl'][0] available_boxes_by_provider = [x.name for x in v.box_list() if x.provider == config['vm_provider']]
logger.info('Adding %s from %s', config['basebox'], baseboxurl) if config['basebox'] not in available_boxes_by_provider:
v.box_add(config['basebox'], baseboxurl) logger.critical("Vagrant box '{basebox}' not available "
needs_mutate = True "for '{vm_provider}' VM provider. "
if needs_mutate: "Please make sure it's added to vagrant. "
logger.info('Converting %s to libvirt format', config['basebox']) "(If you need a basebox to begin with, "
v._call_vagrant_command(['mutate', config['basebox'], 'libvirt']) "here is how we're bootstrapping it: "
logger.info('Removing virtualbox format copy of %s', config['basebox']) "https://gitlab.com/fdroid/basebox)"
v.box_remove(config['basebox'], 'virtualbox') .format(vm_provider=config['vm_provider'],
basebox=config['basebox']))
sys.exit(1)
logger.info("Configuring build server VM") logger.info("Configuring build server VM")
debug_log_vagrant_vm(serverdir, config) debug_log_vagrant_vm(serverdir, config)
@ -559,7 +557,7 @@ def main():
v.up(provision=True) v.up(provision=True)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
debug_log_vagrant_vm(serverdir, config) debug_log_vagrant_vm(serverdir, config)
logger.error("'vagrant up' failed, is the base box missing?") logger.error("'vagrant up' failed.")
sys.exit(1) sys.exit(1)
if config['copy_caches_from_host']: if config['copy_caches_from_host']: