Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions runtime-manager-action/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,19 @@ def runtime_manager_run_self_hosted_deploy(request_data: dict, manifest: dict):
url=url, body=request_data, headers=HEADERS, timeout=TIMEOUT
)

if response.ok:
# Parse the response and extract relevant data
response_data = response.json()
print(f"> Deploy successfully started:\n{json.dumps(response_data, indent=4)}")

# Save the response to the output log
save_output(response_data)
if response.status_code == 201:
try:
# Parse the response and extract relevant data
response_data = response.json()
print(
f"> Deploy successfully started:\n{json.dumps(response_data, indent=4)}"
)

# Save the response to the output log
save_output(response_data)
except json.JSONDecodeError:
print("> Error: Failed to parse JSON response.")
exit(1)
else:
print(
f"> Error: Failed to start self-hosted deploy run. Status: {response.status_code}"
Expand Down
3 changes: 3 additions & 0 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def run_tasks(file_tasks: str, run_action: RunAction):
IAC_SELF_HOSTED=lambda **i: run_action("runtime-iac-action", **i),
DEPLOY_SELF_HOSTED=lambda **i: run_action("runtime-deploy-action", **i),
DESTROY_SELF_HOSTED=lambda **i: run_action("runtime-destroy-action", **i),
PLAN=lambda **i: run_action("runtime-unified-action", **i),
UNIFIED_IAC=lambda **i: run_action("runtime-unified-action", **i),
UNIFIED_DEPLOY=lambda **i: run_action("runtime-unified-action", **i),
UNIFIED_DESTROY=lambda **i: run_action("runtime-unified-action", **i),
Expand All @@ -63,6 +64,8 @@ def run_tasks(file_tasks: str, run_action: RunAction):
runner = task_runners.get(task_type)
if "UNIFIED" in task_type:
runner and runner(run_id=data.get("runId"))
elif "PLAN" == task_type:
runner and runner(run_id=data.get("runId"))
else:
runner and runner(run_task_id=t["runTaskId"])

Expand Down