ci: rebuild backend golden image on lockfile changes
Some checks failed
CI/CD Pipeline / Quality Gate (push) Failing after 19s
CI/CD Pipeline / Build and Push Images (push) Has been skipped
CI/CD Pipeline / Deploy Dev in Dokploy (push) Has been skipped
CI/CD Pipeline / Internal Notify (push) Successful in 0s

This commit is contained in:
2026-05-19 20:26:18 +02:00
parent b8a18d6da4
commit a12d7e2e5d
2 changed files with 9 additions and 1 deletions

View File

@@ -104,9 +104,16 @@ jobs:
fi fi
docker buildx inspect --bootstrap docker buildx inspect --bootstrap
lockfile_sha="$(sha256sum uv.lock | awk '{ print $1 }')"
image_usable() { image_usable() {
docker run --rm "${CI_GOLDEN_REF}:${GOLDEN_TAG}" \ docker run --rm "${CI_GOLDEN_REF}:${GOLDEN_TAG}" \
bash -c '/app/.venv/bin/ruff --version >/dev/null && /app/.venv/bin/python -m pytest --version >/dev/null' bash -c "
test -f /app/uv.lock
test \"\$(sha256sum /app/uv.lock | awk '{ print \$1 }')\" = '${lockfile_sha}'
/app/.venv/bin/ruff --version >/dev/null
/app/.venv/bin/python -m pytest --version >/dev/null
"
} }
if ! docker buildx imagetools inspect "${CI_GOLDEN_REF}:${GOLDEN_TAG}" >/dev/null 2>&1 || ! image_usable; then if ! docker buildx imagetools inspect "${CI_GOLDEN_REF}:${GOLDEN_TAG}" >/dev/null 2>&1 || ! image_usable; then

View File

@@ -52,6 +52,7 @@ RUN uv sync --frozen --no-install-project --dev
FROM base AS ci-deps-base FROM base AS ci-deps-base
COPY --from=ci-deps-build /app/.venv /app/.venv COPY --from=ci-deps-build /app/.venv /app/.venv
COPY pyproject.toml uv.lock ./
ENV PATH="/app/.venv/bin:${PATH}" \ ENV PATH="/app/.venv/bin:${PATH}" \
PYTHONPATH=/workspace/src \ PYTHONPATH=/workspace/src \