简体   繁体   English

GitLab 每次提交一个管道(而不是推送)

[英]GitLab one pipeline per commit (instead of push)

In our GitLab we have a repo with a CI/DI pipeline setup.在我们的 GitLab 中,我们有一个带有 CI/DI 管道设置的存储库。 However, what I noticed is that the pipeline runs once per push and not once per commit.但是,我注意到管道每次推送运行一次,而不是每次提交运行一次。 Let us say your push included 3 commits, but you want to deploy the first commit, how can you do this?假设您的推送包含 3 个提交,但您想部署第一个提交,您怎么做?

Because the pipeline instance will on the last of the 3 commits and you would be able to deploy the last commit, but what happens if you wanted to deploy the first commit in the batch of commits you pushed.因为管道实例将在 3 个提交中的最后一个提交,您将能够部署最后一个提交,但是如果您想部署您推送的一批提交中的第一个提交会发生什么。 How to handle this situtation如何处理这种情况

  1. Create different branches for development and deploydevelopmentdeploy创建不同的分支
  2. Change the pipeline to run on the deploy branch更改管道以在deploy分支上运行
  3. Only merge what you need from development to deploy只合并您从developmentdeploy

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

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