Skip to content

Commit

Permalink
wip: Exit polling loop if status is complete, both password and ip ar…
Browse files Browse the repository at this point in the history
…e set
  • Loading branch information
jcfr committed May 7, 2024
1 parent 592cbdf commit 42713d0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,22 @@ jobs:
jq -r .exoSetup | \
jq -r .status)
if [ "$status" = "complete" ]; then
echo "Status is complete. Exiting loop."
has_pwd=$(
openstack server show $INSTANCE_NAME -c tags -f json | \
jq -r '.tags[] | startswith("exoPw")')
has_ip=$(
openstack server show $INSTANCE_NAME -c addresses -f json | \
jq -r '.addresses.auto_allocated_network[1] != null'
)
echo -n "status [$status], has_pwd [$has_pwd], has_ip [$has_ip]. "
if [[ "$status" = "complete" && $has_pwd && $has_ip ]]; then
echo "Exiting loop."
break
else
echo "Status is $status. Waiting for completion..."
echo "Waiting for completion..."
sleep $wait_interval
total_wait_time=$((total_wait_time + wait_interval))
fi
Expand Down

0 comments on commit 42713d0

Please sign in to comment.