mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-20 18:24:45 +00:00
spike(OPS50): probe gateway do bridge
This commit is contained in:
parent
c8ca121e15
commit
ef7ae55f2e
1 changed files with 11 additions and 15 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: Spike — service postgres em porta própria
|
name: Spike — service postgres via gateway do bridge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -22,21 +22,17 @@ jobs:
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 12
|
--health-retries 12
|
||||||
steps:
|
steps:
|
||||||
- name: Probe aliases v2
|
- name: Probe gateway
|
||||||
run: |
|
run: |
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
for target in postgres:5432 localhost:5433 127.0.0.1:5433; do
|
GW=$(ip route | awk '/default/ {print $3; exit}')
|
||||||
host="${target%:*}"
|
echo "gateway=$GW"
|
||||||
port="${target#*:}"
|
for i in $(seq 1 15); do
|
||||||
if (echo > /dev/tcp/"$host"/"$port") 2>/dev/null; then
|
if (echo > /dev/tcp/"$GW"/5433) 2>/dev/null; then
|
||||||
echo "REACHABLE: $target"
|
echo "REACHABLE: gateway:$GW:5433"
|
||||||
else
|
exit 0
|
||||||
echo "unreachable: $target"
|
|
||||||
fi
|
fi
|
||||||
|
sleep 2
|
||||||
done
|
done
|
||||||
if (echo > /dev/tcp/postgres/5432) 2>/dev/null; then
|
echo "FINAL: gateway $GW:5433 unreachable"
|
||||||
echo "FINAL: postgres:5432 OK"
|
exit 1
|
||||||
else
|
|
||||||
echo "FINAL: nada alcançável"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue