禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它 [英] Disable pipeline for every commit in Gitlab and only run it on open merge request

查看:64
本文介绍了禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CI管道在我工作的Gitlab存储库中的每次提交上运行.有没有办法禁用它,并且仅在对master分支的打开合并请求上运行CI管道?

The CI pipeline runs on every commit in my Gitlab repository at work. Is there way to disable that and only run the CI pipeline on an open merge request to the master branch?

感谢您的帮助.谢谢.

推荐答案

当前没有配置选项可以执行此操作.这里有一些可以用来禁用"管道构建的东西.

There is currently no configuration option to do that. Here are some things that can be used to "disable" a pipeline build.

  • 在提交消息中添加 [ci skip] 不会触发推送管道.
  • 在管道中的所有作业上
  • 使用 except only 选项.为避免这种情况下的重复,您可以使用锚点.
  • Adding [ci skip] inside the commit message will not trigger a pipeline on push.
  • Using except and only options on all jobs inside the pipeline. To avoid duplication in this case, you can use Anchors.

更新:GitLab 11.7

当推送到GitLab时,您可以通过将ci.skip选项传递给push命令来跳过触发管道的操作: git push -o ci.skip

When pushing to GitLab you can skip triggering a pipeline by passing ci.skip option to the push command: git push -o ci.skip

这篇关于禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆