Commit 1b477f33 authored by Marcel Amirault's avatar Marcel Amirault Committed by Suzanne Selhorn

Update style of interruptible keyword

parent 5a60628d
...@@ -3774,25 +3774,19 @@ The trigger token is different than the [`trigger`](#trigger) keyword. ...@@ -3774,25 +3774,19 @@ The trigger token is different than the [`trigger`](#trigger) keyword.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32022) in GitLab 12.3. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32022) in GitLab 12.3.
Use `interruptible` to indicate that a running job should be canceled if made redundant by a newer pipeline run. Use `interruptible` if a job should be canceled when a newer pipeline starts before the job completes.
Defaults to `false` (uninterruptible). Jobs that have not started yet (pending) are considered interruptible
and safe to be cancelled.
This value is used only if the [automatic cancellation of redundant pipelines feature](../pipelines/settings.md#auto-cancel-redundant-pipelines)
is enabled.
When enabled, a pipeline is immediately canceled when a new pipeline starts on the same branch if either of the following is true: This keyword is used with the [automatic cancellation of redundant pipelines](../pipelines/settings.md#auto-cancel-redundant-pipelines)
feature. When enabled, a running job with `interruptible: true` can be cancelled when
a new pipeline starts on the same branch.
- All jobs in the pipeline are set as interruptible. You can't cancel subsequent jobs after a job with `interruptible: false` starts.
- Any uninterruptible jobs have not started yet.
Set jobs as interruptible that can be safely canceled once started (for instance, a build job). **Keyword type**: Job keyword. You can use it only as part of a job.
In the following example, a new pipeline run causes an existing running pipeline to be:
- Canceled, if only `step-1` is running or pending. **Possible inputs**: `true` or `false` (default).
- Not canceled, once `step-2` starts running.
After an uninterruptible job starts running, the pipeline cannot be canceled. **Example of `interruptible`**:
```yaml ```yaml
stages: stages:
...@@ -3818,6 +3812,18 @@ step-3: ...@@ -3818,6 +3812,18 @@ step-3:
interruptible: true interruptible: true
``` ```
In this example, a new pipeline causes a running pipeline to be:
- Canceled, if only `step-1` is running or pending.
- Not canceled, after `step-2` starts.
**Additional details**:
- Only set `interruptible: true` if the job can be safely canceled after it has started,
like a build job. Deployment jobs usually shouldn't be cancelled, to prevent partial deployments.
- To completely cancel a running pipeline, all jobs must have `interruptible: true`,
or `interruptible: false` jobs must not have started.
### `resource_group` ### `resource_group`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15536) in GitLab 12.7. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15536) in GitLab 12.7.
......
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