Git Azure Devops 2019 上 CI/CD 的分支策略

Git branching strategies for CI/CD on Azure Devops 2019

我正在 Azure devops 上设置 CI/CD 管道。

当 master 分支的构建完成时执行这个。

我被要求设置上图的阶段,下一个是哪个描述:

  1. 开发、QA 和生产:在服务器上发布构建工件(每一个)。
  2. 测试:使用katalon studio执行一些自动化测试。

我的问题是,当我创建一个开发分支时,这个管道无法为构建执行,因为管道只是在我提交到主分支时执行,然后我创建另一个 CI/CD 管道开发分支,从主 CI/CD 管道中删除开发阶段并将其合并到这个新管道中。

我的问题是……这样对吗? ,当你有这种管道时,git 分支的最佳策略是什么?

My problem is that, when I create a Development branch this pipeline cannot be executed for the build, because the pipeline is just executed when I commit to the master branch, then I create another CI/CD pipeline for Development branch

对于这个问题,您不需要这样做。你只需要在build Triggers中将Development分支添加到Continuous Integration的Branch filters中即可。

然后将 Development 分支添加到 Continuous deployment 触发器的 Build 分支过滤器中。

设置后,提交到开发分支时,也会触发构建和发布流水线