Commit 9aeabc20 authored by Rémy Coutable's avatar Rémy Coutable

Make all jobs interruptible except the 'dont-interrupt-me' job

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5468ce7e
...@@ -16,6 +16,8 @@ stages: ...@@ -16,6 +16,8 @@ stages:
default: default:
tags: tags:
- gitlab-org - gitlab-org
# All jobs are interruptible by default
interruptible: true
workflow: workflow:
rules: rules:
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
.if-master-refs: &if-master-refs .if-master-refs: &if-master-refs
if: '$CI_COMMIT_REF_NAME == "master"' if: '$CI_COMMIT_REF_NAME == "master"'
.if-auto-deploy-branches: &if-auto-deploy-branches
if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
.if-master-or-tag: &if-master-or-tag .if-master-or-tag: &if-master-or-tag
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_TAG' if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_TAG'
...@@ -509,6 +512,14 @@ ...@@ -509,6 +512,14 @@
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
when: on_success when: on_success
.setup:rules:dont-interrupt-me:
rules:
- <<: *if-master-or-tag
when: on_success
- <<: *if-auto-deploy-branches
when: on_success
- when: manual
.setup:rules:gitlab_git_test: .setup:rules:gitlab_git_test:
rules: rules:
- <<: *if-default-refs - <<: *if-default-refs
......
...@@ -23,6 +23,18 @@ cache gems: ...@@ -23,6 +23,18 @@ cache gems:
- .default-retry - .default-retry
needs: [] needs: []
dont-interrupt-me:
extends: .setup:rules:dont-interrupt-me
stage: prepare
image: alpine:edge
interruptible: false
allow_failure: true
variables:
GIT_STRATEGY: none
dependencies: []
script:
- echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
gitlab_git_test: gitlab_git_test:
extends: extends:
- .minimal-job - .minimal-job
......
...@@ -142,6 +142,15 @@ and included in `rules` definitions via [YAML anchors](../ci/yaml/README.md#anch ...@@ -142,6 +142,15 @@ and included in `rules` definitions via [YAML anchors](../ci/yaml/README.md#anch
| `code-qa-patterns` | Combination of `code-patterns` and `qa-patterns`. | | `code-qa-patterns` | Combination of `code-patterns` and `qa-patterns`. |
| `code-backstage-qa-patterns` | Combination of `code-patterns`, `backstage-patterns`, and `qa-patterns`. | | `code-backstage-qa-patterns` | Combination of `code-patterns`, `backstage-patterns`, and `qa-patterns`. |
## Interruptible jobs pipelines
By default, all jobs are [interruptible](../ci/yaml/README.md#interruptible), except the
`dont-interrupt-me` job which runs automatically on `master`, and is `manual`
otherwise.
If you want a running pipeline to finish even if you push new commits to a merge
request, be sure to start the `dont-interrupt-me` job before pushing.
## Directed acyclic graph ## Directed acyclic graph
We're using the [`needs:`](../ci/yaml/README.md#needs) keyword to We're using the [`needs:`](../ci/yaml/README.md#needs) keyword to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment