ci: fix workflow - remove concurrency, use retry smoke test
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 2s

This commit is contained in:
2026-04-26 12:14:20 +02:00
parent 499f58f617
commit 4e4202742f

View File

@@ -4,10 +4,6 @@ on:
push:
branches: [main]
concurrency:
group: deploy-backend
cancel-in-progress: true
jobs:
deploy:
name: Deploy backend to staging
@@ -28,19 +24,25 @@ jobs:
-f /opt/encoach/overrides/encoach.override.yml \
up -d --build --remove-orphans
- name: Smoke test
- name: Smoke test (wait up to 3 min for Odoo)
run: |
echo "Waiting 60s for Odoo to become healthy..."
sleep 60
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 http://localhost:8069/api/health)
echo "Polling Odoo /api/health (max 180s)..."
for i in $(seq 1 18); do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 http://localhost:8069/api/health 2>/dev/null || echo "000")
if [ "$STATUS" = "200" ]; then
echo "Odoo is healthy after $((i*10))s"
break
fi
echo " attempt $i: $STATUS — waiting 10s..."
sleep 10
done
if [ "$STATUS" != "200" ]; then
echo "ERROR: /api/health returned $STATUS"
echo "ERROR: Odoo /api/health still $STATUS after 180s"
exit 1
fi
FE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 http://localhost:3000/)
FE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 http://localhost:3000/ 2>/dev/null || echo "000")
if [ "$FE" != "200" ]; then
echo "ERROR: Frontend returned $FE"
exit 1
fi
echo "All OK — Odoo=$STATUS Frontend=$FE"
# trigger
echo "All OK — Odoo=200 Frontend=$FE"