如何从Jenkinsfile中的scm更改禁用自动构建 [英] How to disable automatic build from scm change in Jenkinsfile

查看:1372
本文介绍了如何从Jenkinsfile中的scm更改禁用自动构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkinsfile,已经为pipelineTriggers参数设置了cron.我似乎无法弄清楚如何禁用从回购的合并到主分支的构建工作. Jenkinsfile中是否可以通过scm更改禁用自动构建?

I have a Jenkinsfile that I've set up with a cron for a pipelineTriggers parameter. I can't seem to figure out how to disable the job from building from a merge to the master branch of the repo. Is there a way in the Jenkinsfile to disable the automatic build from an scm change?

推荐答案

如果您使用的是多分支管道,则应该能够在作业的配置"页面上执行此操作:

If you're using a Multibranch Pipeline, you should be able to do this on the job's Configure page:

  1. 向下滚动到分支来源"
  2. 在属性策略"下,选择命名分支获得不同的属性"
  3. 点击添加例外",输入"master"作为分支名称
  4. 点击添加属性",选择禁止自动SCM触发"
  5. 保存

这将防止对master分支的更改触发相应作业的构建.

That would prevent changes to the master branch from triggering a build of the corresponding job.

这篇关于如何从Jenkinsfile中的scm更改禁用自动构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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