ci: v0.13.0 — drop daemon probing; runner provides docker out of the box
CI / build + unit + e2e (pull_request) Failing after 10m35s
CI / build + unit + e2e (pull_request) Failing after 10m35s
This commit is contained in:
+6
-44
@@ -15,49 +15,11 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Full-dind runner: job containers already reach the runner's own docker daemon
|
# The runner provides a working docker CLI out of the box (full-dind) — no endpoint
|
||||||
# (pre-set DOCKER_HOST and/or a mounted /var/run/docker.sock) — no dind service.
|
# resolution needed. Job and app containers share the daemon, so put them on one
|
||||||
# Find a working endpoint and export it as DOCKER_HOST for all later steps.
|
# user-defined network and reach the app by service DNS (the job's netns has no
|
||||||
- name: Resolve docker daemon
|
# default route here, so host-IP URLs are unreliable). The alias `app` is declared
|
||||||
run: |
|
# in docker-compose.ci.yml.
|
||||||
set -u
|
|
||||||
|
|
||||||
# 1) A pre-set DOCKER_HOST that answers is used as-is, no probing.
|
|
||||||
if [ -n "${DOCKER_HOST:-}" ]; then
|
|
||||||
i=0
|
|
||||||
while [ "$i" -lt 5 ]; do
|
|
||||||
if docker version --format '{{.Server.Version}}' >/dev/null 2>&1; then
|
|
||||||
echo "using pre-set DOCKER_HOST=$DOCKER_HOST"
|
|
||||||
echo "DOCKER_HOST=$DOCKER_HOST" >> "$GITHUB_ENV"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
i=$((i+1)); sleep 2
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 2) Otherwise probe candidates in order (short retry each).
|
|
||||||
tried=""
|
|
||||||
for ep in "${DOCKER_HOST:-}" unix:///var/run/docker.sock tcp://localhost:2375 tcp://localhost:2376 tcp://docker:2375 tcp://docker:2376; do
|
|
||||||
[ -n "$ep" ] || continue
|
|
||||||
case " $tried " in *" $ep "*) continue ;; esac
|
|
||||||
tried="$tried $ep"
|
|
||||||
i=0
|
|
||||||
while [ "$i" -lt 10 ]; do
|
|
||||||
if DOCKER_HOST="$ep" docker version --format '{{.Server.Version}}' >/dev/null 2>&1; then
|
|
||||||
echo "using probed endpoint $ep"
|
|
||||||
echo "DOCKER_HOST=$ep" >> "$GITHUB_ENV"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
i=$((i+1)); sleep 2
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "::error::no reachable docker daemon (tried: ${DOCKER_HOST:-<unset>}, unix:///var/run/docker.sock, tcp://localhost:2375, tcp://localhost:2376, tcp://docker:2375, tcp://docker:2376)" >&2
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
# Job and app containers share the daemon, so put them on one user-defined network
|
|
||||||
# and reach the app by service DNS — no endpoint-derived URLs (the job's netns has
|
|
||||||
# no default route on this runner). The alias `app` is declared in docker-compose.ci.yml.
|
|
||||||
- name: Prepare e2e network
|
- name: Prepare e2e network
|
||||||
run: |
|
run: |
|
||||||
set -u
|
set -u
|
||||||
@@ -99,7 +61,7 @@ jobs:
|
|||||||
# flight-ci keeps it distinct from production. E2E_DEPLOY_CMD makes the config's
|
# flight-ci keeps it distinct from production. E2E_DEPLOY_CMD makes the config's
|
||||||
# webServer block deploy + wait for readiness (http://app:3000 via service DNS);
|
# webServer block deploy + wait for readiness (http://app:3000 via service DNS);
|
||||||
# E2E_COMPOSE_ARGS points state.spec.ts' mid-run `docker compose restart flight` at
|
# E2E_COMPOSE_ARGS points state.spec.ts' mid-run `docker compose restart flight` at
|
||||||
# the same file + project. DOCKER_HOST/E2E_BASE_URL come from GITHUB_ENV above.
|
# the same file + project. E2E_BASE_URL comes from GITHUB_ENV (Prepare e2e network).
|
||||||
- name: E2E (isolated stack in dind)
|
- name: E2E (isolated stack in dind)
|
||||||
env:
|
env:
|
||||||
PW_REMOTE_BROWSER: "0"
|
PW_REMOTE_BROWSER: "0"
|
||||||
|
|||||||
Reference in New Issue
Block a user