Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,28 @@ jobs:
exit 1
fi &&

celery_status="$(docker inspect -f '{{.State.Status}}' api_celery 2>/dev/null || true)" &&
celery_status="" &&
celery_ping="" &&
for attempt in $(seq 1 24); do
celery_status="$(docker inspect -f '{{.State.Status}}' api_celery 2>/dev/null || true)" &&
if [ "$celery_status" = "running" ]; then
celery_ping="$(docker compose -f docker-compose.dev-ci.yml exec -T celerys sh -lc 'celery -A procollab inspect ping -d \"celery@$(hostname)\"' 2>&1 || true)" &&
printf '%s\n' "$celery_ping" &&
if printf '%s\n' "$celery_ping" | grep -q 'pong'; then
echo "Celery check passed on attempt ${attempt}" &&
break
fi
fi &&

sleep 5
done &&

if [ "$celery_status" != "running" ]; then
echo "Celery container is not running: ${celery_status}" >&2 &&
exit 1
fi
fi &&

printf '%s\n' "$celery_ping" | grep -q 'pong' || {
echo "Celery ping failed" >&2
exit 1
}
22 changes: 21 additions & 1 deletion .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,28 @@ jobs:
exit 1
fi

celery_status="$(docker inspect -f '{{.State.Status}}' api_celery 2>/dev/null || true)"
celery_status=""
celery_ping=""
for attempt in $(seq 1 24); do
celery_status="$(docker inspect -f '{{.State.Status}}' api_celery 2>/dev/null || true)"
if [ "$celery_status" = "running" ]; then
celery_ping="$(docker compose -f docker-compose.prod-ci.yml -p prod exec -T celerys sh -lc 'celery -A procollab inspect ping -d \"celery@$(hostname)\"' 2>&1 || true)"
printf '%s\n' "$celery_ping"
if printf '%s\n' "$celery_ping" | grep -q 'pong'; then
echo "Celery check passed on attempt ${attempt}"
break
fi
fi

sleep 5
done

if [ "$celery_status" != "running" ]; then
echo "Celery container is not running: ${celery_status}" >&2
exit 1
fi

printf '%s\n' "$celery_ping" | grep -q 'pong' || {
echo "Celery ping failed" >&2
exit 1
}
2 changes: 1 addition & 1 deletion docker-compose.dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- "127.0.0.1:8000:8000"

redis:
image: redis:7.2.5
image: redis:latest
restart: unless-stopped
expose:
- 6379
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
ports:
- "127.0.0.1:8000:8000"
redis:
image: redis:7.2.5
image: redis:latest
restart: unless-stopped
expose:
- 6379
Expand Down
Loading