Commit f7a2c3f0 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

docs: add hard disable job example

parent 7132ccab
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -420,3 +420,27 @@ According to the Kubernetes template implementation, that can be done by overrid
```

This way, all Kubernetes jobs will inherit this configuration.

### Example 3: disable go-mod-outdated job

There are a few _to be continuous_ jobs that can't be disabled.
It is the case for example of the `go-mod-outdated` job from the Golang template (actually this job is a pure manually triggered job).

Let's suppose in my project I don't want this job to appear in my pipelines.

That can be done by simply overriding the `go-mod-outdated` job rules as follows:

```yaml
include:
  - project: 'to-be-continuous/golang'
    file: '/templates/gitlab-ci-golang.yml'
    ref: '4.0.0'

# hard disable go-mod-outdated
go-mod-outdated:
  rules:
    - when: never
```

This way, the job won't never appear in the project pipeline.
This technique may be used to hard-disable any non-configurable _to be continuous_ job.