File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 9797 consul : true
9898 dynamodb : true
9999
100+ - name : Wait for Consul to be ready
101+ run : |
102+ $timeout = 30
103+ $elapsed = 0
104+ while ($elapsed -lt $timeout) {
105+ try {
106+ $response = Invoke-RestMethod -Uri 'http://127.0.0.1:8500/v1/status/leader' -TimeoutSec 2
107+ if ($response -and $response -ne '""') {
108+ Write-Host "Consul is ready (leader: $response)"
109+ exit 0
110+ }
111+ } catch {}
112+ Write-Host "Waiting for Consul to elect a leader... ($elapsed/$timeout seconds)"
113+ Start-Sleep -Seconds 1
114+ $elapsed++
115+ }
116+ Write-Error "Consul did not become ready within $timeout seconds"
117+ exit 1
118+
100119 - name : Install poetry
101120 uses : abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
102121
You can’t perform that action at this time.
0 commit comments