.build_and_push: stage: custom needs: [] tags: - docker - high-cpu variables: QEMU_IMAGE: tonistiigi/binfmt:qemu-v6.2.0 timeout: 2 hours before_script: - echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin - | if [ "${ARCH:-amd64}" != "amd64" ]; then echo -e "\033[1;33mInstalling latest qemu emulators\033[0m" docker pull -q ${QEMU_IMAGE}; docker run --rm --privileged ${QEMU_IMAGE} --uninstall qemu-*; docker run --rm --privileged ${QEMU_IMAGE} --install all; fi script: - ./scripts/lib/custom-docker-build rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_SERVER_HOST == "gitlab.com"' variables: BASE_BUILD_REGISTRY_IMAGE: registry.gitlab.com/gitlab-org/gitlab-build-images - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_SERVER_HOST == "gitlab.com"' variables: PUSH_CUSTOM_IMAGE: "true" BASE_BUILD_REGISTRY_IMAGE: registry.gitlab.com/gitlab-org/gitlab-build-images - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && ($CI_SERVER_HOST == "ops.gitlab.net" || $CI_SERVER_HOST == "dev.gitlab.org")' variables: PUSH_CUSTOM_IMAGE: "true" BASE_BUILD_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE