I have in my .gitlab-ci.yml some test stages. When I push my project to another gitlab server, these stages will fail, because no suitable runners are attached.
Thus I would like to do something like this to prevent these tests from running on other gitlab servers.
.only_deif:
rules:
- if: '$CI_SERVER_HOST == "gitlab.deif.com"'
test_deif:
extends: .only_deif
script:
- set
This however creates two pipelines, which I do not want.
I have tried with this
.only_deif:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: '$CI_SERVER_HOST == "gitlab.deif.com"'
But then I will get a green pipeline on the merge request, even if it fails.
This also behaves bad as it does not build before the MR is made, and does not build on merge to master.
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE != "push"'
There must be somebody who have done this trick.
GitLab Community Edition 13.12.4