From a57eb80f8fd3d1849f913dd05f8ed6971be0b433 Mon Sep 17 00:00:00 2001 From: aron Date: Fri, 30 Aug 2024 13:35:57 +0200 Subject: [PATCH] Cache pdfviewer instead of pdfviewer-dev --- .gitlab-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfe666803..28d5d20f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -113,14 +113,14 @@ build-test-frontend: script: - ISO_WEEK=$(date +%V) - | - for img in pdfviewer-dev frontend-dev; do + for img in pdfviewer frontend-dev; do if ! docker manifest inspect $CI_REGISTRY_IMAGE/$img:$ISO_WEEK > /dev/null; then docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --no-cache --pull --target=$img --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/$img:$ISO_WEEK . else - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$ISO_WEEK --cache-from $CI_REGISTRY_IMAGE/frontend-dev:$ISO_WEEK --target=$img --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/$img:$ISO_WEEK . + docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$ISO_WEEK --cache-from $CI_REGISTRY_IMAGE/frontend-dev:$ISO_WEEK --target=$img --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/$img:$ISO_WEEK . fi done - - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$ISO_WEEK --cache-from $CI_REGISTRY_IMAGE/frontend-dev:$ISO_WEEK --target=frontend-test --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/frontend-test:$CI_COMMIT_SHORT_SHA . + - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$ISO_WEEK --cache-from $CI_REGISTRY_IMAGE/frontend-dev:$ISO_WEEK --target=frontend-test --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/frontend-test:$CI_COMMIT_SHORT_SHA . test-api: stage: test @@ -186,15 +186,15 @@ build-release: # Build/push depending stages # rendering docker buildx imagetools create $CI_REGISTRY_IMAGE/rendering:$ISO_WEEK --tag $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG - # pdfviewer-dev - docker buildx imagetools create $CI_REGISTRY_IMAGE/pdfviewer-dev:$ISO_WEEK --tag $CI_REGISTRY_IMAGE/pdfviewer-dev:$TEST_CI_COMMIT_TAG + # pdfviewer + docker buildx imagetools create $CI_REGISTRY_IMAGE/pdfviewer:$ISO_WEEK --tag $CI_REGISTRY_IMAGE/pdfviewer:$TEST_CI_COMMIT_TAG # frontend if ! docker manifest inspect $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG > /dev/null; then - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/frontend-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$TEST_CI_COMMIT_TAG --target=frontend --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG . + docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/frontend-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$TEST_CI_COMMIT_TAG --target=frontend --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG . fi # api-statics if ! docker manifest inspect $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG > /dev/null; then - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api-statics --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG . + docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api-statics --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG . fi fi # Build containers @@ -204,7 +204,7 @@ build-release: - export VERSION_NUMBER - | if ! docker manifest inspect $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG > /dev/null; then - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg VERSION="$VERSION_NUMBER" --cache-from $CI_REGISTRY_IMAGE/api-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api --platform linux/amd64,linux/arm64 --push --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG . + docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg VERSION="$VERSION_NUMBER" --cache-from $CI_REGISTRY_IMAGE/api-test:$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api --platform linux/amd64,linux/arm64 --push --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG . fi @@ -246,7 +246,7 @@ release-prod: - rm -rf docs/docs/s docs/README.md docs/reporting_software.yml docs/wip docs/hooks.py dev .vscode api/.vscode # Build container with copyleft source code - - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg VERSION="$VERSION_NUMBER" --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer-dev:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api-src --platform linux/amd64,linux/arm64 --push --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER-src . + - docker buildx build --provenance false --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg VERSION="$VERSION_NUMBER" --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-statics:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/frontend:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/pdfviewer:$TEST_CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/rendering:$TEST_CI_COMMIT_TAG --target=api-src --platform linux/amd64,linux/arm64 --push --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER-src . # Push containers to Docker Hub - docker buildx imagetools create $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER - docker buildx imagetools create $DOCKER_HUB_IMAGE:$VERSION_NUMBER --tag $DOCKER_HUB_IMAGE:latest