fix(ci): reuse ApiTests image in e2e instead of blind rebuild.
e2e pulled/reused eventhub-tests from test job or registry; plain buildkit logs if rebuild needed. Root cause of #342 e2e cancel: quiet rebuild + prune + timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -141,6 +141,10 @@ jobs:
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub:${VER_TAG}"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub:ift"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub:dev"
|
||||
# Тот же ApiTests-образ для e2e-ift/stage — без повторной сборки
|
||||
docker tag eventhub-tests:latest "${REGISTRY}/eventhub-api-tests:${TAG}"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub-api-tests:${TAG}"
|
||||
echo "Pushed ${REGISTRY}/eventhub-api-tests:${TAG}"
|
||||
|
||||
- name: Prune old registry images
|
||||
if: github.event_name == 'push'
|
||||
@@ -283,6 +287,8 @@ jobs:
|
||||
ADMIN_API_HOST: ${{ secrets.E2E_IFT_ADMIN_API_HOST }}
|
||||
WS_HOST: ${{ secrets.E2E_IFT_WS_HOST }}
|
||||
ADMIN_WS_HOST: ${{ secrets.E2E_IFT_ADMIN_WS_HOST }}
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: bash scripts/run-stand-api-tests.sh ift
|
||||
|
||||
deploy-stage:
|
||||
@@ -401,4 +407,6 @@ jobs:
|
||||
ADMIN_API_HOST: ${{ secrets.E2E_STAGE_ADMIN_API_HOST }}
|
||||
WS_HOST: ${{ secrets.E2E_STAGE_WS_HOST }}
|
||||
ADMIN_WS_HOST: ${{ secrets.E2E_STAGE_ADMIN_WS_HOST }}
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: bash scripts/run-stand-api-tests.sh stage
|
||||
|
||||
@@ -45,20 +45,49 @@ echo " WS_HOST=${WS_HOST}"
|
||||
echo " ADMIN_WS_HOST=${ADMIN_WS_HOST}"
|
||||
|
||||
IMAGE="eventhub-api-tests:local"
|
||||
REG_IMAGE=""
|
||||
if [[ -n "${GITHUB_SHA:-}" ]]; then
|
||||
IMAGE="eventhub-api-tests:sha-${GITHUB_SHA:0:12}"
|
||||
REG_IMAGE="${REGISTRY:-git.sabilin.com/eventhub}/eventhub-api-tests:sha-${GITHUB_SHA:0:12}"
|
||||
fi
|
||||
|
||||
echo "=== build API test image (${IMAGE}) ==="
|
||||
echo "=== ensure API test image (${IMAGE}) ==="
|
||||
have_image=0
|
||||
if docker image inspect "${IMAGE}" >/dev/null 2>&1; then
|
||||
echo " local image present: ${IMAGE}"
|
||||
have_image=1
|
||||
elif docker image inspect eventhub-tests:latest >/dev/null 2>&1; then
|
||||
# act/hostexecutor: test job уже собрал тот же Dockerfile
|
||||
docker tag eventhub-tests:latest "${IMAGE}"
|
||||
echo " reused local eventhub-tests:latest → ${IMAGE}"
|
||||
have_image=1
|
||||
elif [[ -n "${REG_IMAGE}" ]]; then
|
||||
if [[ -n "${REGISTRY_USER:-}" && -n "${REGISTRY_PASSWORD:-}" ]]; then
|
||||
echo "${REGISTRY_PASSWORD}" | docker login git.sabilin.com -u "${REGISTRY_USER}" --password-stdin >/dev/null
|
||||
fi
|
||||
if docker pull "${REG_IMAGE}"; then
|
||||
docker tag "${REG_IMAGE}" "${IMAGE}"
|
||||
echo " pulled ${REG_IMAGE}"
|
||||
have_image=1
|
||||
else
|
||||
echo " pull failed — will rebuild"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${have_image}" -ne 1 ]]; then
|
||||
# plain: иначе BUILDKIT_PROGRESS=quiet прячет причину падения rebar3
|
||||
export BUILDKIT_PROGRESS="${BUILDKIT_PROGRESS:-plain}"
|
||||
bash scripts/retry-docker-build.sh 5 60 -- \
|
||||
docker buildx build \
|
||||
--network=host \
|
||||
--progress=plain \
|
||||
--file docker/ApiTests.Dockerfile \
|
||||
--tag "${IMAGE}" \
|
||||
--load \
|
||||
--provenance=false \
|
||||
--sbom=false \
|
||||
.
|
||||
fi
|
||||
|
||||
docker run --rm --network=host \
|
||||
-e CT_MODE=remote \
|
||||
|
||||
Reference in New Issue
Block a user