diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index 634c6e79..568df646 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -210,7 +210,7 @@ jobs: ssh root@ns.testrun.org systemctl reload nsd - name: cmdeploy test - run: CHATMAIL_DOMAIN2=ci-chatmail.testrun.org cmdeploy test --slow + run: CHATMAIL_DOCKER=chatmail CHATMAIL_DOMAIN2=ci-chatmail.testrun.org cmdeploy test --slow - name: cmdeploy dns run: | @@ -337,7 +337,7 @@ jobs: ssh root@ns.testrun.org systemctl reload nsd - name: cmdeploy test - run: CHATMAIL_DOMAIN2=ci-chatmail.testrun.org cmdeploy test --slow + run: CHATMAIL_DOCKER=chatmail CHATMAIL_DOMAIN2=ci-chatmail.testrun.org cmdeploy test --slow - name: cmdeploy dns run: | diff --git a/cmdeploy/src/cmdeploy/sshexec.py b/cmdeploy/src/cmdeploy/sshexec.py index 6a37b939..04968637 100644 --- a/cmdeploy/src/cmdeploy/sshexec.py +++ b/cmdeploy/src/cmdeploy/sshexec.py @@ -50,6 +50,9 @@ class SSHExec: FuncError = FuncError def __init__(self, host, verbose=False, python="python3", timeout=60): + docker_container = os.environ.get("CHATMAIL_DOCKER") + if docker_container: + python = f"docker exec -i {docker_container} python3" self.gateway = execnet.makegateway(f"ssh=root@{host}//python={python}") self._remote_cmdloop_channel = bootstrap_remote(self.gateway, remote) self.timeout = timeout diff --git a/cmdeploy/src/cmdeploy/tests/plugin.py b/cmdeploy/src/cmdeploy/tests/plugin.py index 34f258df..08ce9b33 100644 --- a/cmdeploy/src/cmdeploy/tests/plugin.py +++ b/cmdeploy/src/cmdeploy/tests/plugin.py @@ -402,6 +402,9 @@ class Remote: case "@local": command = [] case "localhost": command = [] case _: command = ["ssh", f"root@{self.sshdomain}"] + docker_container = os.environ.get("CHATMAIL_DOCKER") + if docker_container: + command += ["docker", "exec", docker_container] [command.append(arg) for arg in getjournal.split()] self.popen = subprocess.Popen( command,