mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
Update pipeline setup
This commit is contained in:
parent
f6beca8712
commit
9d5972d125
3 changed files with 21 additions and 9 deletions
|
|
@ -21,6 +21,7 @@ stages:
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
|
BASE_BUILD_REGISTRY_IMAGE: registry.gitlab.com/gitlab-org/gitlab-build-images
|
||||||
|
|
||||||
cache-chrome-chromium:
|
cache-chrome-chromium:
|
||||||
extends: .cache-google-chrome
|
extends: .cache-google-chrome
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,27 @@
|
||||||
.build_and_push:
|
.install-qemu:
|
||||||
stage: custom
|
timeout: 2 hours # builds with emulation can take a long time to complete
|
||||||
needs: []
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- high-cpu
|
- high-cpu
|
||||||
variables:
|
variables:
|
||||||
QEMU_IMAGE: tonistiigi/binfmt:qemu-v6.2.0
|
QEMU_IMAGE: tonistiigi/binfmt:qemu-v6.2.0
|
||||||
timeout: 2 hours
|
|
||||||
before_script:
|
before_script:
|
||||||
- echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
|
|
||||||
- |
|
- |
|
||||||
if [ "${ARCH:-amd64}" != "amd64" ]; then
|
if [ "$PUSH_CUSTOM_IMAGE" == "true" ]; then
|
||||||
|
echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
|
||||||
|
fi
|
||||||
|
- |
|
||||||
|
if [[ "${ARCH:-amd64}" =~ arm64 ]]; then
|
||||||
echo -e "\033[1;33mInstalling latest qemu emulators\033[0m"
|
echo -e "\033[1;33mInstalling latest qemu emulators\033[0m"
|
||||||
docker pull -q ${QEMU_IMAGE};
|
docker pull -q ${QEMU_IMAGE};
|
||||||
docker run --rm --privileged ${QEMU_IMAGE} --uninstall qemu-*;
|
docker run --rm --privileged ${QEMU_IMAGE} --uninstall qemu-*;
|
||||||
docker run --rm --privileged ${QEMU_IMAGE} --install all;
|
docker run --rm --privileged ${QEMU_IMAGE} --install all;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
.build_and_push:
|
||||||
|
stage: custom
|
||||||
|
extends: .install-qemu
|
||||||
|
needs: []
|
||||||
script:
|
script:
|
||||||
- ./scripts/lib/custom-docker-build
|
- ./scripts/lib/custom-docker-build
|
||||||
rules:
|
rules:
|
||||||
|
|
@ -33,16 +39,20 @@
|
||||||
|
|
||||||
.cache-google-chrome:
|
.cache-google-chrome:
|
||||||
stage: automation
|
stage: automation
|
||||||
|
extends: .install-qemu
|
||||||
needs: []
|
needs: []
|
||||||
|
variables:
|
||||||
|
ARCH: linux/amd64,linux/arm64
|
||||||
before_script:
|
before_script:
|
||||||
- docker buildx create --use
|
- !reference [.install-qemu, before_script]
|
||||||
|
- docker buildx create --use # creates context that's capable of building multiple architectures in parallel
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
--build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
||||||
--build-arg CI_PROJECT_ID=$CI_PROJECT_ID \
|
--build-arg CI_PROJECT_ID=$CI_PROJECT_ID \
|
||||||
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN \
|
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform $ARCH \
|
||||||
-f "Dockerfile.cache-chrome" \
|
-f "Dockerfile.cache-chrome" \
|
||||||
.
|
.
|
||||||
rules:
|
rules:
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,9 @@ function cache-chromium() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "Updating system utils"
|
||||||
apt-get -y -qq update
|
apt-get -y -qq update
|
||||||
apt-get -y install apt-utils curl bash gnupg2 > /dev/null
|
apt-get -y install apt-utils curl gnupg2 > /dev/null
|
||||||
|
|
||||||
if [ "$TARGETARCH" == "amd64" ]; then
|
if [ "$TARGETARCH" == "amd64" ]; then
|
||||||
cache-chrome
|
cache-chrome
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue