diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d26214ce12888c87395cb447dd2b89308bbbc3c7..1da859b788d10ca1d585c17e7a593a93741cd475 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,8 @@ variables: EXIT_CODE_NON_BE: 123 EXIT_CODE_FAIL: 1 +default: + interruptible: true # Make all jobs by default interruptible # This sets when pipelines are created. Jobs have more specific rules to restrict them. workflow: @@ -23,6 +25,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'web' # for testing stages: + - .pre - maintenance - build - test @@ -168,6 +171,31 @@ stages: - 123 + +# --------------------------------------------------------------- +# .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-linux + + + # --------------------------------------------------------------- # Validation jobs # ---------------------------------------------------------------