Commit 0ffffa04 authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch 'docs-interruptible-keyword-reference' into 'master'

Update style of interruptible keyword

See merge request gitlab-org/gitlab!70262
parents 86b7a10f 1b477f33
......@@ -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.
Use `interruptible` to indicate that a running job should be canceled if made redundant by a newer pipeline run.
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.
Use `interruptible` if a job should be canceled when a newer pipeline starts before the job completes.
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.
- Any uninterruptible jobs have not started yet.
You can't cancel subsequent jobs after a job with `interruptible: false` starts.
Set jobs as interruptible that can be safely canceled once started (for instance, a build job).
In the following example, a new pipeline run causes an existing running pipeline to be:
**Keyword type**: Job keyword. You can use it only as part of a job.
- Canceled, if only `step-1` is running or pending.
- Not canceled, once `step-2` starts running.
**Possible inputs**: `true` or `false` (default).
After an uninterruptible job starts running, the pipeline cannot be canceled.
**Example of `interruptible`**:
```yaml
stages:
......@@ -3818,6 +3812,18 @@ step-3:
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`
> [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