mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-28 15:43:10 +00:00
spike(OPS50): probe de alias do service postgres
This commit is contained in:
parent
d34f723db8
commit
890e1609cf
1 changed files with 15 additions and 9 deletions
|
|
@ -22,15 +22,21 @@ jobs:
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 12
|
--health-retries 12
|
||||||
steps:
|
steps:
|
||||||
- name: Probe TCP localhost:5433
|
- name: Probe aliases
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -uo pipefail
|
||||||
for i in $(seq 1 20); do
|
for target in postgres:5432 localhost:5433 127.0.0.1:5433; do
|
||||||
if (echo > /dev/tcp/localhost/5433) 2>/dev/null; then
|
host="${target%:*}"
|
||||||
echo "CONNECTED to localhost:5433"
|
port="${target#*:}"
|
||||||
exit 0
|
if (echo > /dev/tcp/"$host"/"$port") 2>/dev/null; then
|
||||||
|
echo "REACHABLE: $target"
|
||||||
|
else
|
||||||
|
echo "unreachable: $target"
|
||||||
fi
|
fi
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
echo "FAILED to reach localhost:5433"
|
if (echo > /dev/tcp/postgres/5432) 2>/dev/null; then
|
||||||
exit 1
|
echo "FINAL: postgres:5432 OK"
|
||||||
|
else
|
||||||
|
echo "FINAL: nada alcançável"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue