diff options
author | Peter Krempa <pkrempa@redhat.com> | 2024-10-22 13:39:00 +0200 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2024-10-22 13:49:34 +0200 |
commit | d6d3834440b0fe8105cd3b572b9c011672b17ac6 (patch) | |
tree | deac361292e794f6567fda65a5b96e405dcd578c | |
parent | f6b1dd176aaab29789be67b15c12f19fc6ba9fa2 (diff) | |
download | libvirt-ci-d6d3834440b0fe8105cd3b572b9c011672b17ac6.zip libvirt-ci-d6d3834440b0fe8105cd3b572b9c011672b17ac6.tar.gz libvirt-ci-d6d3834440b0fe8105cd3b572b9c011672b17ac6.tar.bz2 |
cirrus-run: Avoid hard job failure when CI credits run out
Recently the libvirt project started to run out of CI credits on cirrus
towards the end of the month. As this is annoying we'd prefer if the job
is allowed to fail in such case.
This patch (temporarily) switches to 'cirrus-run' version with patches
allowing detection of CI credit failure, which also returns a different
error code allowing us to allow return code '3' to be considered an
allowed failure.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
-rw-r--r-- | containers/cirrus-run/Dockerfile | 4 | ||||
-rw-r--r-- | lcitool/gitlab.py | 2 | ||||
-rw-r--r-- | tests/data/manifest/out/ci/gitlab/build-templates.yml | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/containers/cirrus-run/Dockerfile b/containers/cirrus-run/Dockerfile index c59809c..78aafcd 100644 --- a/containers/cirrus-run/Dockerfile +++ b/containers/cirrus-run/Dockerfile @@ -2,4 +2,6 @@ FROM docker.io/library/python:3.9-alpine COPY cirrus-vars.py /usr/bin/cirrus-vars -RUN pip3 install cirrus-run==1.0.1 +#RUN pip3 install cirrus-run==1.0.1 +RUN apk add git +RUN pip3 install 'cirrus-run @ git+https://github.com/pipo/cirrus-run@job-credits-2' diff --git a/lcitool/gitlab.py b/lcitool/gitlab.py index e5e2142..606c411 100644 --- a/lcitool/gitlab.py +++ b/lcitool/gitlab.py @@ -338,6 +338,8 @@ def cirrus_template(cidir): image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest interruptible: true needs: [] + allow_failure: + exit_codes: 3 script: - set -o allexport - source {cidir}/cirrus/$NAME.vars diff --git a/tests/data/manifest/out/ci/gitlab/build-templates.yml b/tests/data/manifest/out/ci/gitlab/build-templates.yml index 9aa81a1..825c658 100644 --- a/tests/data/manifest/out/ci/gitlab/build-templates.yml +++ b/tests/data/manifest/out/ci/gitlab/build-templates.yml @@ -275,6 +275,8 @@ image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest interruptible: true needs: [] + allow_failure: + exit_codes: 3 script: - set -o allexport - source ci/cirrus/$NAME.vars |