fix(ci): give the image smoke test a config and doctor the real container paths
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 9m7s
CI / Dependency audit (push) Successful in 15s
CI / Tests (Linux) (push) Successful in 14m33s
Release / ci (push) Successful in 14m33s
Release / Build image (arm64) (push) Failing after 21s
Release / Build image (amd64) (push) Successful in 28s
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 9m7s
CI / Dependency audit (push) Successful in 15s
CI / Tests (Linux) (push) Successful in 14m33s
Release / ci (push) Successful in 14m33s
Release / Build image (arm64) (push) Failing after 21s
Release / Build image (amd64) (push) Successful in 28s
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
The image ships no /config (compose mounts it), so the container exited at start; doctor also looked at relative default paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c560297bb9
commit
75df6ba642
1 file changed
+10
-2
+10
-2
@@ -12,14 +12,22 @@ name="xexeu-smoke-$$-$RANDOM"
|
|||||||
trap 'docker rm -f "$name" >/dev/null 2>&1 || true' EXIT
|
trap 'docker rm -f "$name" >/dev/null 2>&1 || true' EXIT
|
||||||
fail() { echo "smoke: $*" >&2; docker logs "$name" >&2 2>&1 || true; exit 1; }
|
fail() { echo "smoke: $*" >&2; docker logs "$name" >&2 2>&1 || true; exit 1; }
|
||||||
|
|
||||||
docker run -d --name "$name" "$image" >/dev/null
|
# The image ships no config (compose mounts ./config), so copy the example in.
|
||||||
|
# docker cp instead of a bind mount: the daemon may not see this job's paths.
|
||||||
|
cfg=$(mktemp -d)
|
||||||
|
trap 'rm -rf "$cfg"; docker rm -f "$name" >/dev/null 2>&1 || true' EXIT
|
||||||
|
mkdir "$cfg/config"
|
||||||
|
cp "$(dirname "$0")/../examples/xexeu.toml" "$cfg/config/xexeu.toml"
|
||||||
|
docker create --name "$name" "$image" >/dev/null
|
||||||
|
tar -C "$cfg" -c config | docker cp - "$name:/"
|
||||||
|
docker start "$name" >/dev/null
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health >/dev/null 2>&1 && break
|
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health >/dev/null 2>&1 && break
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health | grep -q '"status":"ok"' || fail "/api/health did not answer"
|
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health | grep -q '"status":"ok"' || fail "/api/health did not answer"
|
||||||
docker exec "$name" curl -fsS http://127.0.0.1:8788/ | grep -qi '<!doctype html' || fail "dashboard is not served"
|
docker exec "$name" curl -fsS http://127.0.0.1:8788/ | grep -qi '<!doctype html' || fail "dashboard is not served"
|
||||||
docker exec "$name" xexeu doctor --json | grep -q '"version"' || fail "xexeu doctor --json failed"
|
docker exec "$name" xexeu doctor --json --config /config/xexeu.toml --data-dir /data/xexeu | grep -q '"version"' || fail "xexeu doctor --json failed"
|
||||||
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
|
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
|
||||||
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
|
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
|
||||||
docker stop -t 10 "$name" >/dev/null
|
docker stop -t 10 "$name" >/dev/null
|
||||||
|
|||||||
Reference in new issue
Block a user