Skip to content
Merged
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
10 changes: 9 additions & 1 deletion ctfcli/utils/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,21 @@ def cloud(challenge, host, protocol):
service_id = service["id"]
service = s.get(f"/api/v1/services/{service_id}", json=True).json()["data"]

while service["hostname"] is None:
DEPLOY_TIMEOUT = 180
while service["hostname"] is None and DEPLOY_TIMEOUT > 0:
click.secho(
"Waiting for challenge hostname", fg="yellow",
)
service = s.get(f"/api/v1/services/{service_id}", json=True).json()["data"]
DEPLOY_TIMEOUT -= 10
time.sleep(10)

if DEPLOY_TIMEOUT == 0:
click.secho(
"Timeout waiting for challenge to deploy", fg="red",
)
return False, None, None, None

# Expose port if we are using tcp
if protocol == "tcp":
service = s.patch(f"/api/v1/services/{service['id']}", json={"expose": True})
Expand Down