From 633883408ba5f5a55099e7f280e30757eb05ae65 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 19 Sep 2024 09:11:17 +0200 Subject: [PATCH] prevent interrupts on main branch --- .gitlab-ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a7b3425a..714b2c1c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,6 +87,7 @@ workflow: stages: + - .pre - prevalidate - build - test @@ -469,6 +470,28 @@ stages: junit: - report-junit.xml +# --------------------------------------------------------------- +# .pre jobs for setting up things +# --------------------------------------------------------------- + +# See: https://gitlab.com/gitlab-org/gitlab/-/issues/194023 +# Solution to make main branch pipelines uninterruptible while all other +# pipelines can be interrupted by default. This works because all jobs +# after uninterruptible jobs will be uninterruptible. Resource group +# setting avoids rare case where two fast merges could still interrupt +# pipeline. This should be revisited if there are updates to Gitlab. +uninterruptible: + stage: .pre + interruptible: false + resource_group: uninterruptible + script: + - echo "$CI_COMMIT_BRANCH is uninterruptible" + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: always + tags: + - ivas-basop-linux + # --------------------------------------------------------------- # verification jobs # --------------------------------------------------------------- -- GitLab