summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCédric Tabin <tabin.cedric@gmail.com>2019-09-05 14:50:39 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-09-05 14:50:39 +0000
commite195e48638dcc56609436e6fcdd9ad3521501798 (patch)
treef5bef05404ba10a9eeb897f8e9a40725019a8525 /doc
parentbe920a6056b1b2bbc376af43d9aef8df92f090f6 (diff)
downloadgitlab-ce-e195e48638dcc56609436e6fcdd9ad3521501798.tar.gz
New interruptible attribute supported in YAML parsing.
Since it is not possible to dynamically detect if a job is automatically cancellable or not, a this new attribute is necessary. Moreover, it let the maintainer of the repo to adjust the behaviour of the auto cancellation feature to match exactly what he needs.
Diffstat (limited to 'doc')
-rw-r--r--doc/ci/yaml/README.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index bfba21646b5..8f2e95dbb10 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -116,6 +116,7 @@ The following table lists available parameters for jobs:
| [`extends`](#extends) | Configuration entries that this job is going to inherit from. |
| [`pages`](#pages) | Upload the result of a job to use with GitLab Pages. |
| [`variables`](#variables) | Define job variables on a job level. |
+| [interruptible](#interruptible) | Defines if a job can be canceled when made redundant by a newer run |
NOTE: **Note:**
Parameters `types` and `type` are [deprecated](#deprecated-parameters).
@@ -2083,6 +2084,46 @@ staging:
branch: stable
```
+### `interruptible`
+
+`interruptible` is used to indicate that a job should be canceled if made redundant by a newer run of the same job. Defaults to `false` if there is an environment defined and `true` otherwise.
+This value will only be used if the [automatic cancellation of redundant pipelines feature](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#auto-cancel-pending-pipelines)
+is enabled.
+
+When enabled, a pipeline on the same branch will be canceled when:
+
+- It is made redundant by a newer pipeline run.
+- Either all jobs are set as interruptible, or any uninterruptible jobs are not yet pending.
+
+Pending jobs are always considered interruptible.
+
+TIP: **Tip:**
+Set jobs as uninterruptible that should behave atomically and should never be canceled once started.
+
+Here is a simple example:
+
+```yaml
+stages:
+ - stage1
+ - stage2
+
+step-1:
+ stage: stage1
+ script:
+ - echo "Can be canceled"
+
+step-2:
+ stage: stage2
+ script:
+ - echo "Can not be canceled"
+ interruptible: false
+```
+
+In the example above, a new pipeline run will cause an existing running pipeline to be:
+
+- Canceled, if only `step-1` is running or pending.
+- Not canceled, once `step-2` becomes pending.
+
### `include`
> - Introduced in [GitLab Premium](https://about.gitlab.com/pricing/) 10.5.