mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-06 13:20:20 +00:00
1c5bc460d3
This refreshes the containers bringing in new behaviour when builds/containers are disabled. Instead of deleting the job entirely, the job still exists but is set to be a manual job. It won't affect the pipeline result, but can be triggered by the developer if they wish to test a specific scenario. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
# THIS FILE WAS AUTO-GENERATED
|
|
#
|
|
# $ lcitool manifest ci/manifest.yml
|
|
#
|
|
# https://gitlab.com/libvirt/libvirt-ci
|
|
|
|
|
|
# For upstream
|
|
#
|
|
# - Push to default branch:
|
|
# -> rebuild if dockerfile changed, no cache
|
|
# - Otherwise
|
|
# -> rebuild if LIBVIRT_CI_CONTAINERS=1, no cache,
|
|
# to pick up new published distro packages or
|
|
# recover from deleted tag
|
|
#
|
|
# For forks
|
|
# - Always rebuild, with cache
|
|
#
|
|
.container_job:
|
|
image: docker:stable
|
|
stage: containers
|
|
needs: []
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest"
|
|
- export COMMON_TAG="$CI_REGISTRY/libvirt/libvirt/ci-$NAME:latest"
|
|
- docker info
|
|
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
|
script:
|
|
- if test $CI_PROJECT_NAMESPACE = "libvirt";
|
|
then
|
|
docker build --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ;
|
|
else
|
|
docker pull "$TAG" || docker pull "$COMMON_TAG" || true ;
|
|
docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ;
|
|
fi
|
|
- docker push "$TAG"
|
|
after_script:
|
|
- docker logout
|
|
rules:
|
|
- if: '$CI_PROJECT_NAMESPACE == "libvirt" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
when: on_success
|
|
changes:
|
|
- ci/gitlab/container-templates.yml
|
|
- ci/containers/$NAME.Dockerfile
|
|
- if: '$CI_PROJECT_NAMESPACE == "libvirt" && $LIBVIRT_CI_CONTAINERS == "1"'
|
|
when: on_success
|
|
- if: '$CI_PROJECT_NAMESPACE == "libvirt"'
|
|
when: never
|
|
- if: '$LIBVIRT_JOB_OPTIONAL'
|
|
when: manual
|
|
allow_failure: true
|
|
- when: on_success
|