cmdeploy: split @local and @docker in SSHExec

This commit is contained in:
missytake
2025-08-26 10:33:14 +02:00
parent 929383df88
commit d2ff812727
2 changed files with 4 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ def run_cmd(args, out):
ssh_host = args.config.mail_domain if not args.ssh_host else args.ssh_host
cmd = f"{pyinf} --ssh-user root {ssh_host} {deploy_path} -y"
if sshexec == "localhost":
if sshexec in ["docker", "localhost"]:
cmd = f"{pyinf} @local {deploy_path} -y"
if version.parse(pyinfra.__version__) < version.parse("3"):
@@ -368,6 +368,8 @@ def main(args=None):
host = args.ssh_host if hasattr(args, "ssh_host") and args.ssh_host else args.config.mail_domain
if host in [ "@local", "localhost" ]:
return "localhost"
elif host == "docker":
return "docker"
print(f"[ssh] login to {host}")
return SSHExec(host, verbose=args.verbose)

View File

@@ -70,7 +70,7 @@ fi
./scripts/cmdeploy init --config "${INI_FILE}" $INI_CMD_ARGS $MAIL_DOMAIN
bash /update_ini.sh
./scripts/cmdeploy run --ssh-host @local --skip-dns-check
./scripts/cmdeploy run --ssh-host docker --skip-dns-check
echo "ForwardToConsole=yes" >> /etc/systemd/journald.conf
systemctl restart systemd-journald