diff --git a/.gitlab/docker-build.yml b/.gitlab/docker-build.yml index 49725030..c4b94020 100644 --- a/.gitlab/docker-build.yml +++ b/.gitlab/docker-build.yml @@ -87,22 +87,23 @@ docker-build-prod: - echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY script: - | - tag="" VERSION="${MAJOR}.${MINOR}.${SUB}-${META}" - | - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" + echo "Running on branch '$CI_COMMIT_BRANCH'" echo "Crafty Version: $VERSION" - docker context create tls-environment - docker buildx create --name zedBuilder --use tls-environment - docker buildx build - --cache-from type=registry,ref="$CI_REGISTRY_IMAGE${tag}" + --cache-from type=registry,ref="$CI_REGISTRY_IMAGE" --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg "BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")" --build-arg "BUILD_REF=${CI_COMMIT_SHA}" --build-arg "CRAFTY_VER=${VERSION}" - --tag "$CI_REGISTRY_IMAGE${tag}" - --platform linux/arm64/v8,linux/amd64 - --push . + --tag "crafty-build" + --platform linux/arm64/v8,linux/amd64 . + - docker image tag "crafty-build" "$CI_REGISTRY_IMAGE" + - docker image tag "crafty-build" "$CI_REGISTRY_IMAGE:${VERSION}" + - docker image push -a after_script: - | docker buildx rm zedBuilder && echo "Successfully Stopped builder instance" || echo "Failed to stop builder instance."