mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-12 22:13:05 +00:00
spike(OPS50): probe de service postgres em porta própria no runner
This commit is contained in:
parent
8d16b8a0cb
commit
d34f723db8
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/spike-services.yml
Normal file
36
.forgejo/workflows/spike-services.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Spike — service postgres em porta própria
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [OPS50-spike-services]
|
||||
|
||||
jobs:
|
||||
probe:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_USER: teqo
|
||||
POSTGRES_PASSWORD: teqo
|
||||
POSTGRES_DB: teqo_test
|
||||
ports:
|
||||
- 5433:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U teqo"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 12
|
||||
steps:
|
||||
- name: Probe TCP localhost:5433
|
||||
run: |
|
||||
set -euo pipefail
|
||||
for i in $(seq 1 20); do
|
||||
if (echo > /dev/tcp/localhost/5433) 2>/dev/null; then
|
||||
echo "CONNECTED to localhost:5433"
|
||||
exit 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "FAILED to reach localhost:5433"
|
||||
exit 1
|
||||
Loading…
Reference in a new issue