Lets Imagine I want to have 2 different CI Pipelines in gitlab. The first one should start with every push on any branch the other one only when the commit title ends with deploy.
How do I realise that?
So my Idea:
.gitlab-ci.yml
stages:
- pre
- build
include:
- local: ci/a.gitlab-ci.yml
- local: ci/b.gitlab-ci.yml
a.gitlab-ci.yml
workflow:
rules:
# only triggered by "-deploy" at the end of commit
- if: $CI_COMMIT_TITLE == /-deploy$/
test-job1:
stage: pre
script:
- echo "Workflow a runs pre."
tags:
- x86
test-job2:
stage: build
script:
- echo "Workflow a runs build."
tags:
- x86
b.gitlab-ci.yml
workflow:
rules:
# only triggered if commit does not end with "-deploy"
- if: $CI_COMMIT_TITLE =~ /-deploy$/
test-job1:
stage: pre
script:
- echo "Workflow b runs pre."
tags:
- x86
test-job2:
stage: build
script:
- echo "Workflow b runs build."
tags:
- x86