[英]Triggering pipeline depending on branch used
I'd like to trigger a pipeline depending on the branch being pushed.我想根据被推送的分支触发管道。 The code at present:目前的代码:
gitlab-ci.yml gitlab-ci.yml
variables:
myvariables....
stages:
- pp
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
variables:
VAR1: ${V_A}
VAR2: ${VB_A}
- if: '$CI_COMMIT_BRANCH == "develop"'
variables:
VAR1: ${V_B}
VAR2: ${VB_B}
credentials:
...
The flint parsing seems fine (so syntactically seems fine), however the correct pipeline is not triggered depending on the branch (so develop/qa).燧石解析看起来不错(所以语法上看起来不错),但是不会根据分支触发正确的管道(所以开发/qa)。 Is this the correct usage of rules?这是规则的正确用法吗?
Use this syntax to apply rules to your whole pipeline (in your .gitlab-ci.yml
file):使用此语法将规则应用于您的整个管道(在您的.gitlab-ci.yml
文件中):
workflow:
rules:
- if: $CI_COMMIT_BRANCH == "master"
variables:
VAR1: ${V_A}
VAR2: ${VB_A}
- if: $CI_COMMIT_BRANCH == "develop"
variables:
VAR1: ${V_B}
VAR2: ${VB_B}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.