如果jenkinsfile不存在,Bitbucket分支源插件将无法扫描

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

我设置了Bitbucket团队项目来扫描组织文件夹并创建管道,但是在没有Jenkinsfile的情况下,该工作失败了

Checking branch master from UKCEP/amatch-acceptance
ERROR: [Thu Jul 04 12:59:03 UTC 2019] Could not fetch sources from navigator com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator@53f18bdb
java.io.IOException: Communication error for url: Jenkinsfile status code: 401
    at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.checkPathExists(BitbucketServerAPIClient.java:478)
    at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$BitbucketProbeFactory$1.exists(BitbucketSCMSource.java:1478)
    at jenkins.scm.api.SCMSourceCriteria$Probe.stat(SCMSourceCriteria.java:99)
    at org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory$1.isHead(WorkflowBranchProjectFactory.java:74)
    at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:342)
    at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieveBranches(BitbucketSCMSource.java:748)
    at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:589)
    at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
    at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263)
    at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1404)
    at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1419)
    at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:254)
    at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:204)
    at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.visitSources(BitbucketSCMNavigator.java:479)
    at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:488)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
    at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:968)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
[Thu Jul 04 12:59:03 UTC 2019] Finished organization scan. Scan took 11 sec
FATAL: Failed to recompute children of EU Keying and Linking
java.io.IOException: Communication error for url: Jenkinsfile status code: 401
    at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.checkPathExists(BitbucketServerAPI

预期结果:没有Jenkinsfile的存储库应被忽略实际输出:上面提到的故障错误

Jenkins版本:2.1.83Bitbucket分支源插件版本:2.4.5

jenkins plugins bitbucket cloudbees bitbucket-pipelines
1个回答
0
投票
如果存在另一个用于标记存储库有效的文件,则可以使用远程文件插件。

在此插件中,有一个名为Local File的字段。如果您在此处定义文件名,例如pom.xml,则只会创建具有此文件的存储库和分支。

这是来自插件的文档。

When using Remote File Plugin, you might want to build only repositories and branches which contain a certain file. In this case, you may specify a Local File in the Plugin SCM Definition. This way, Jenkins will create projects only for repositories and branches containing the file you specified.

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