ci: fix workflow - remove concurrency, use retry smoke test
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 2s
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 2s
This commit is contained in:
@@ -4,10 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: deploy-backend
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy backend to staging
|
name: Deploy backend to staging
|
||||||
@@ -28,19 +24,25 @@ jobs:
|
|||||||
-f /opt/encoach/overrides/encoach.override.yml \
|
-f /opt/encoach/overrides/encoach.override.yml \
|
||||||
up -d --build --remove-orphans
|
up -d --build --remove-orphans
|
||||||
|
|
||||||
- name: Smoke test
|
- name: Smoke test (wait up to 3 min for Odoo)
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting 60s for Odoo to become healthy..."
|
echo "Polling Odoo /api/health (max 180s)..."
|
||||||
sleep 60
|
for i in $(seq 1 18); do
|
||||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 http://localhost:8069/api/health)
|
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
|
if [ "$STATUS" != "200" ]; then
|
||||||
echo "ERROR: /api/health returned $STATUS"
|
echo "ERROR: Odoo /api/health still $STATUS after 180s"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
if [ "$FE" != "200" ]; then
|
||||||
echo "ERROR: Frontend returned $FE"
|
echo "ERROR: Frontend returned $FE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "All OK — Odoo=$STATUS Frontend=$FE"
|
echo "All OK — Odoo=200 Frontend=$FE"
|
||||||
# trigger
|
|
||||||
|
|||||||
Reference in New Issue
Block a user