mirror of
https://github.com/xemu-project/xemu.git
synced 2026-07-11 01:24:41 +02:00
8bec7b9874
This will hopefully catch containers that break because of upstream changes as well as keep the container cache fresh. As we have all the container jobs as dependants we tweaks the container template to allow scheduled runs. Because we added a new rules stanza we also need to make sure we catch the normal runs as well. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20251117115523.3993105-19-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
27 lines
1.1 KiB
YAML
27 lines
1.1 KiB
YAML
.container_job_template:
|
|
extends: .base_job_template
|
|
image: docker:latest
|
|
stage: containers
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:$QEMU_CI_CONTAINER_TAG"
|
|
# Always ':latest' because we always use upstream as a common cache source
|
|
- export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
|
|
- docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
|
- until docker info; do sleep 1; done
|
|
script:
|
|
- echo "TAG:$TAG"
|
|
- echo "COMMON_TAG:$COMMON_TAG"
|
|
- docker build --tag "$TAG" --cache-from "$TAG" --cache-from "$COMMON_TAG"
|
|
--build-arg BUILDKIT_INLINE_CACHE=1
|
|
-f "tests/docker/dockerfiles/$NAME.docker" "."
|
|
- docker push "$TAG"
|
|
after_script:
|
|
- docker logout
|
|
rules:
|
|
# because we want to enable this for scheduled runs we also have to replicate the normal rules
|
|
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
|
- if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~ /^staging/'
|
|
- if: '$QEMU_CI && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
|