Reputation: 1936
I have a job in a GitLab CI pipeline that I want to temporarily disable because it is not working. My test suites are running locally but not inside docker, so until I figure that out I want to skip the test job or the test stage.
I tried commenting out the stage, but then I get an error message from the CI validation: test job: chosen stage does not exist; available stages are .pre, build, deploy, .post
So I can simply comment out the entire job, but I was wondering if there was a better way?
Upvotes: 16
Views: 41804
Reputation: 81
You can also use only
to disable inherited jobs (see Gitlab reference):
inherited-job:
only: []
Upvotes: 0
Reputation: 1328
If you want to disable a job that is defined by a template which has been included (possible from a separate repository), you can use a when: never
rule (gitlab reference), like:
inherited-job:
rules:
- when: never
Upvotes: 2
Reputation: 1936
Turns out, there is! It's quite at the end of the very thorough documentation of GitLab CI: https://docs.gitlab.com/ee/ci/jobs/index.html#hide-jobs
Instead of using comments on the job or stage, simply prefix the job name with a dot .
.
Example from the official documentation:
.hidden_job:
script:
- run test
Upvotes: 26