简体   繁体   English

jenkins SCM checkout poll issue with multiple repo

[英]jenkins SCM checkout poll issue with multiple repo

I have a Jenkins job where I'm checking out 2 repos, The first repo "dev" contains src code and the Jenkinsfile and this repo is configured in Jenkins UI along with PollScm enabled.我有一个 Jenkins 工作,我正在检查 2 个回购协议,第一个回购协议“dev”包含源代码和 Jenkinsfile,这个回购协议是在 Jenkins UI 中配置的,同时启用了 PollScm。 The second repo is "devops", I'm checking out this repo with sparse checkout in groovy script declarative pipeline.第二个回购是“devops”,我在 groovy 脚本声明管道中使用稀疏签出检查这个回购。

        stage('Checkout DevopsScripts') {
        steps {
            script{
                dir('devops'){
                 def scmVar = checkout([$class: 'GitSCM', \
                    branches: [[name: '*/master']], \
                    doGenerateSubmoduleConfigurations: false, \
                    extensions: [[$class: 'SparseCheckoutPaths',  sparseCheckoutPaths:[[$class:'SparseCheckoutPath', path:'Scripts/testScript/']]]], \
                    submoduleCfg: [], \
                    userRemoteConfigs: [[credentialsId: 'XXXXXXX', url: "https://github.com/org/devops.git"]], \
                    poll: false, \
                    changelog: false
                    ])
                }
            }
        }
    }

Now I want PollScm to happen only for the commits happening in the "dev" repo, PollScm should ignore commits happening in "devops" repo.现在我希望 PollScm 只发生在“dev”repo 中发生的提交,PollScm 应该忽略“devops”repo 中发生的提交。 But even after enabling poll: false Jenkins job triggers on any commits happening in either repo.但即使启用 poll: false Jenkins 作业也会触发任一回购中发生的任何提交。 I have scrolled through the document "https://plugins.jenkins.io/workflow-scm-step/" which says "You may specify poll: false to disable polling for an SCM checkout" which is not happening in my case.我滚动浏览了文档“https://plugins.jenkins.io/workflow-scm-step/”,上面写着“您可以指定轮询:false 以禁用对 SCM 结帐的轮询”,这在我的案例中没有发生。 Is there a bug in Jenkins related to this issue or I'm missing anything here. Jenkins 中是否存在与此问题相关的错误,或者我在这里遗漏了任何内容。

This is a known bug in Jenkins that is unfixed as of 2022-11-23.这是 Jenkins 中的一个已知错误,截至 2022 年 11 月 23 日尚未修复。 See Jenkins-60757 on the bug tracker : '"poll: false" has no effect in scm (and git) pipeline steps'.请参阅错误跟踪器上的 Jenkins-60757 :““poll: false”对 scm(和 git)管道步骤没有影响”。

So, basically the poll: false flag doesn't work right now.所以,基本上poll: false标志现在不起作用。

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

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