3
I’m using Gitlab for code evolution management. It’s all quiet about it. Usage merge-requests to review code changes. I also generally use the Gitflow, only using the name rc-*
for launch branches (Gitflow provides release-*
).
Briefly about Gitflow, it has nomenclature for branhces, house one has a goal:
master
is the branch with the production code, therefore relatively stable codedevelop
is the branch with the development code, so relatively unstable coderc-*
is the branch with the launch candidate (release candidate), is derived from thedevelop
and (when mature enough) will be integrated into themaster
ex:
rc-1.2
is the release candidate for the version1.2
In Gitlab, I can set up a build using the Gitlab CI. This configuration is done in the file .gitlab-ci.yml
. In this configuration file, I can determine Jobs which are executed conditionally (documentation).
For example, I might want Gitlab to only run job deploy-lib
in the branches master
and develop
:
build:
stage: build
script:
- mvn compile
deploy-lib:
stage: deploy
script:
- mvn deploy
only:
- master
- develop
I’d like to add one job to only run in branches that follow the Pattern rc-*
. I found nothing in the documentation regarding Pattern name to the jobs:only
, but this is used in various corners on the Gitlab web.
So I ask:
- I can configure for Gitlab-CI to only run certain job for branches that Pattern
rc-*
? If yes, how do I do it?