管道:SCM步骤:检出扩展名[排除的区域]

问题描述 投票:0回答:1

我在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
jenkins-pipeline jenkins-plugins
1个回答
0
投票

不幸的是,詹金斯中的空值都无法按预期工作。尝试定义

© www.soinside.com 2019 - 2024. All rights reserved.