简体   繁体   English

gitlab-ci - 有 2 个分支的仓库,2 个 gitlab-ci

[英]gitlab-ci - repo with 2 branches, 2 gitlab-ci

I'm crash coursing myself on GitLab and trying to understand how the CI features work.我在 GitLab 上崩溃并试图了解 CI 功能的工作原理。 I've noticed that it allows you to have a GitLab-ci.yml per branch in a given repo.我注意到它允许您在给定的存储库中为每个分支拥有一个 GitLab-ci.yml。 I've also just learned about the "only" keyword that allows me to limit the scope of a specific job to a particular branch.我还刚刚了解了“唯一”关键字,它允许我将特定作业的 scope 限制到特定分支。

But I have the following questions.但我有以下问题。

  1. If you don't have any "only" clauses, and the pipeline triggers, can i assume that the GitLab-ci.yml that will run is the one that's associated with the branch that just committed a change?如果您没有任何“唯一”子句,并且管道触发,我可以假设将运行的 GitLab-ci.yml 是与刚刚提交更改的分支相关联的那个吗?
  2. is there any scenario when a single GitLab-ci.yml without an only clause runs against multiple branches in a repo?当一个没有 only 子句的 GitLab-ci.yml 对 repo 中的多个分支运行时,是否有任何情况?

THanks.谢谢。

The pipeline will be only trigger on the branch you committed except if you explicit use trigger keyword to trigger other projects or branches.管道只会在您提交的分支上触发,除非您明确使用 trigger 关键字来触发其他项目或分支。 Keyword like only, except, rules are used as conditions to run a specific step.关键字 like only,except,规则用作运行特定步骤的条件。 By exemple, you can use only master for your deploy-production step.例如,您只能将 master 用于部署-生产步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM