Skip to content

Commit

Permalink
feat: awesome, socket is working.
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ-Jackson committed Jan 24, 2025
1 parent e6994f5 commit 8d57503
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
5 changes: 1 addition & 4 deletions client/run-deploy-remote-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ def clear_keys():

try:
subprocess.run([
"ssh", ssh_address, "--", env_token, env_key, "doas", "/opt/run-deploy/bin/run-deploy-cli"
"ssh", ssh_address, "--", env_token, env_key, "/opt/run-deploy/bin/run-deploy-socket", "cli"
] + sys.argv[2:], check=True)
# subprocess.run([
# "ssh", ssh_address, "--", env_token, env_key, "/opt/run-deploy/bin/run-deploy-socket", "cli"
# ] + sys.argv[2:], check=True)
except subprocess.CalledProcessError as e:
exit(e.returncode)
5 changes: 1 addition & 4 deletions client/run-deploy-remote-metal-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ def clear_keys():

try:
subprocess.run([
"ssh", ssh_address, "--", env_token, env_key, "doas", "/opt/run-deploy/bin/run-deploy-metal-cli"
"ssh", ssh_address, "--", env_token, env_key, "/opt/run-deploy/bin/run-deploy-socket", "cli-metal"
] + sys.argv[2:], check=True)
# subprocess.run([
# "ssh", ssh_address, "--", env_token, env_key, "/opt/run-deploy/bin/run-deploy-socket", "cli-metal"
# ] + sys.argv[2:], check=True)
except subprocess.CalledProcessError as e:
exit(e.returncode)
4 changes: 2 additions & 2 deletions remote-incus/run-deploy-socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def handle_fifo(fifo_path: str):
time.sleep(1)
with open(fifo_path, "r") as fifo:
data = json.load(fifo)
if data["code"] > 0:
if (data["stderr"]):
print(data["stderr"], file=sys.stderr)
else:
if (data["stdout"]):
print(data["stdout"])
exit(data["code"])

Expand Down
4 changes: 2 additions & 2 deletions remote-metal/run-deploy-socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def handle_fifo(fifo_path: str):
time.sleep(1)
with open(fifo_path, "r") as fifo:
data = json.load(fifo)
if data["code"] > 0:
if (data["stderr"]):
print(data["stderr"], file=sys.stderr)
else:
if (data["stdout"]):
print(data["stdout"])
exit(data["code"])

Expand Down
6 changes: 3 additions & 3 deletions toml-util/run-deploy-remote-toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def create(cls, data: dict) -> Self:
toml_manifest = None

remote_cli = "run-deploy-remote-cli"
remote_deploy = "/opt/run-deploy/bin/run-deploy"
remote_deploy = "deploy"


process_error_message = "Did you check that you got the SSH Private Key in the agent? Does `minisign.key` require a password? =D"
Expand Down Expand Up @@ -405,10 +405,10 @@ def create(cls, data: dict) -> Self:
for ssh_address, ssh_config in deploy_data.ssh_configs.items():
current_remote_deploy = remote_deploy
if ssh_config.is_metal:
current_remote_deploy = "/opt/run-deploy/bin/run-deploy-metal"
current_remote_deploy = "deploy-metal"
print(f"-- Deploying: {ssh_address} --", file=sys.stderr)
process_data = subprocess.run([
"ssh", ssh_address, "--", "doas", current_remote_deploy,
"ssh", ssh_address, "--", "/opt/run-deploy/bin/run-deploy-socket", current_remote_deploy,
f"{ssh_config.upload}/{base_image_name}",
f"{key_ref}"
], check=True, capture_output=True)
Expand Down

0 comments on commit 8d57503

Please sign in to comment.