mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	makebuildserver: stop trying to write to Vagrantfile.yaml
If Vagrantfile.yaml exists, makebuildserver should no longer try to write to it. It is now manully managed now that makebuildserver.config.py no longer exists. Also, now that the buildserver is smaller, the workflow is to always destroy and recreate it rather than ever try to reprovision it.
This commit is contained in:
		
							parent
							
								
									b709ce8255
								
							
						
					
					
						commit
						6ec7e05c76
					
				
					 1 changed files with 2 additions and 23 deletions
				
			
		| 
						 | 
				
			
			@ -102,11 +102,11 @@ elif os.path.exists('makebs.config.py'):
 | 
			
		|||
    # this is the old name for the config file
 | 
			
		||||
    logging.error('makebs.config.py exists!')
 | 
			
		||||
if show_config_deprecation:
 | 
			
		||||
    logging.error('Config is via buildserver/Vagrantfile.yaml and command line flags.')
 | 
			
		||||
    logging.error('Config is via %s and command line flags.' % configfile)
 | 
			
		||||
    parser.print_help()
 | 
			
		||||
    exit(1)
 | 
			
		||||
 | 
			
		||||
logging.debug("makebuildserver.config.py parsed -> %s", json.dumps(config, indent=4, sort_keys=True))
 | 
			
		||||
logging.debug("Vagrantfile.yaml parsed -> %s", json.dumps(config, indent=4, sort_keys=True))
 | 
			
		||||
 | 
			
		||||
# Update cached files.
 | 
			
		||||
if not os.path.exists(config['cachedir']):
 | 
			
		||||
| 
						 | 
				
			
			@ -284,27 +284,6 @@ def main():
 | 
			
		|||
    if options.clean:
 | 
			
		||||
        vm.destroy()
 | 
			
		||||
 | 
			
		||||
    # Check against the existing Vagrantfile.yaml, and if they differ, we
 | 
			
		||||
    # need to create a new box:
 | 
			
		||||
    vf = os.path.join(serverdir, 'Vagrantfile.yaml')
 | 
			
		||||
    writevf = True
 | 
			
		||||
    if os.path.exists(vf):
 | 
			
		||||
        logging.info('Halting %s', serverdir)
 | 
			
		||||
        v.halt()
 | 
			
		||||
        with open(vf, 'r', encoding='utf-8') as f:
 | 
			
		||||
            oldconfig = yaml.safe_load(f)
 | 
			
		||||
        if config != oldconfig:
 | 
			
		||||
            logging.info("Server configuration has changed, rebuild from scratch is required")
 | 
			
		||||
            vm.destroy()
 | 
			
		||||
        else:
 | 
			
		||||
            logging.info("Re-provisioning existing server")
 | 
			
		||||
            writevf = False
 | 
			
		||||
    else:
 | 
			
		||||
        logging.info("No existing server - building from scratch")
 | 
			
		||||
    if writevf:
 | 
			
		||||
        with open(vf, 'w', encoding='utf-8') as f:
 | 
			
		||||
            yaml.safe_dump(config, f)
 | 
			
		||||
 | 
			
		||||
    # Check if selected provider is supported
 | 
			
		||||
    if config['vm_provider'] not in ['libvirt', 'virtualbox']:
 | 
			
		||||
        logging.critical("Currently selected VM provider '{vm_provider}' "
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue