cli machines update: run deploy directly if deploying single machine
This commit is contained in:
@@ -10,6 +10,7 @@ T = TypeVar("T")
|
||||
|
||||
class MachineGroup:
|
||||
def __init__(self, machines: list[Machine]) -> None:
|
||||
self.machines = machines
|
||||
self.group = HostGroup([m.target_host for m in machines])
|
||||
|
||||
def __repr__(self) -> str:
|
||||
|
||||
@@ -120,6 +120,7 @@ def deploy_machine(machines: MachineGroup) -> None:
|
||||
generate_vars([machine], None, False)
|
||||
|
||||
upload_secrets(machine)
|
||||
|
||||
path = upload_sources(
|
||||
machine,
|
||||
)
|
||||
@@ -151,7 +152,10 @@ def deploy_machine(machines: MachineGroup) -> None:
|
||||
if ret.returncode != 0:
|
||||
ret = host.run(cmd, extra_env=env)
|
||||
|
||||
machines.run_function(deploy)
|
||||
if len(machines.group.hosts) > 1:
|
||||
machines.run_function(deploy)
|
||||
else:
|
||||
deploy(machines.machines[0])
|
||||
|
||||
|
||||
def update(args: argparse.Namespace) -> None:
|
||||
|
||||
Reference in New Issue
Block a user