mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	🥊 add vagrant support to exec subcommand
This commit is contained in:
		
							parent
							
								
									63660e1aed
								
							
						
					
					
						commit
						60f5f8fa1c
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -5183,6 +5183,23 @@ def get_vagrantfile_path(appid, vercode):
 | 
			
		|||
 | 
			
		||||
def vagrant_exec(appid, vercode, command):
 | 
			
		||||
    """Execute a command in the Vagrant VM via ssh."""
 | 
			
		||||
    vagrantfile = get_vagrantfile_path(appid, vercode)
 | 
			
		||||
    to_stdin = shlex.join(command)
 | 
			
		||||
    p = subprocess.run(
 | 
			
		||||
        [
 | 
			
		||||
            'vagrant',
 | 
			
		||||
            'ssh',
 | 
			
		||||
            '-c',
 | 
			
		||||
            'bash',
 | 
			
		||||
        ],
 | 
			
		||||
        input=to_stdin,
 | 
			
		||||
        text=True,
 | 
			
		||||
        cwd=vagrantfile.parent,
 | 
			
		||||
    )
 | 
			
		||||
    if p.returncode != 0:
 | 
			
		||||
        raise subprocess.CalledProcessError(
 | 
			
		||||
            p.returncode, f"{to_stdin} | {' '.join(p.args)}"
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def vagrant_destroy(appid, vercode):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue