我在Pipeline:SCM步骤Checkout插件中使用排除区域/包含区域时遇到问题。我的管道脚本从多个Repos克隆代码。但是,我不希望该作业因所有这些Repos中的更改而被触发。因此,为了抑制其中一个Repo中的构建形式更改,我尝试使用扩展。但似乎此功能无法正常工作。
我的管道脚本中有以下代码:
dir ('script') {dir ('script') {
checkout([
$class : 'GitSCM',
branches : [[name: '*/master']],
extensions : [
[$class: 'PathRestriction', excludedRegions: ''],
[$class: 'CleanBeforeCheckout'],
[$class: 'DisableRemotePoll']
],
userRemoteConfigs: [[
credentialsId: '12345-xxxxx',
name : 'origin',
refspec : '+refs/heads/:refs/remotes/origin/+refs/pull/*:refs/remotes/origin/pr/ *',
url : 'https://wwwin-github.company.com/myrepo/mycode'
]]
])
}```
With the above code, I am under impression that the all changes will be excluded as I kep "excludedRegions" as empty. I have also added '$class:DisableRemotePoll' to see if that works. None of the above could prevent the build for any changes in the repo.
Could someone pls guide me on how to suppress triggering builds for any repo that I clone in my pipeline script?
Thanks
-hyvrt
不幸的是,詹金斯中的空值都无法按预期工作。尝试定义