mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-05-10 08:46:11 -04:00
🥊 add vagrant support to exec subcommand
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
63660e1aed
commit
60f5f8fa1c
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user