ci: split build/up steps with plain progress for debugging
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 1s
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 1s
This commit is contained in:
@@ -16,34 +16,35 @@ jobs:
|
||||
git reset --hard origin/main
|
||||
echo "Deployed: $(git log -1 --oneline)"
|
||||
|
||||
- name: Rebuild and restart containers
|
||||
- name: Build Docker images
|
||||
run: |
|
||||
export DOCKER_BUILDKIT=1
|
||||
export BUILDKIT_PROGRESS=plain
|
||||
cd /opt/encoach/encoach_backend_new_v2
|
||||
docker compose \
|
||||
-f docker-compose.yml \
|
||||
-f /opt/encoach/overrides/encoach.override.yml \
|
||||
build --no-cache --progress=plain 2>&1
|
||||
|
||||
- name: Start containers
|
||||
run: |
|
||||
cd /opt/encoach/encoach_backend_new_v2
|
||||
docker compose \
|
||||
-f docker-compose.yml \
|
||||
-f /opt/encoach/overrides/encoach.override.yml \
|
||||
up -d --build --remove-orphans
|
||||
up -d --remove-orphans
|
||||
|
||||
- name: Smoke test (wait up to 3 min for Odoo)
|
||||
- name: Smoke test
|
||||
run: |
|
||||
echo "Polling Odoo /api/health (max 180s)..."
|
||||
STATUS="000"
|
||||
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
|
||||
[ "$STATUS" = "200" ] && echo "Odoo healthy after $((i*10))s" && break
|
||||
echo " attempt $i: $STATUS — waiting 10s..."
|
||||
sleep 10
|
||||
done
|
||||
if [ "$STATUS" != "200" ]; then
|
||||
echo "ERROR: Odoo /api/health still $STATUS after 180s"
|
||||
exit 1
|
||||
fi
|
||||
[ "$STATUS" != "200" ] && echo "ERROR: Odoo still $STATUS after 180s" && exit 1
|
||||
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
|
||||
[ "$FE" != "200" ] && echo "ERROR: Frontend $FE" && exit 1
|
||||
echo "All OK — Odoo=200 Frontend=$FE"
|
||||
# test-1777198872
|
||||
|
||||
Reference in New Issue
Block a user