首页 > 解决方案 > 非主分支未在 Jenkins 中构建

问题描述

我的代码仓库在 bitbucket 上是私有的,我的父 bbranch 是 masster-php7 而不是 master。我从 master-php7 创建了一个 bbranch 并做了一些更改。现在我想从这个分支构建,但仍然失败。

在仪表板上,此消息在 10 分钟后打印

git fetch --no-tags --progress -- https://abc@bitbucket.org/def/xyz.git +refs/heads/ :refs/remotes/origin/# timeout=10 错误: java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:502) at java.lang.UNIXProcess.waitFor(UNIXProcess) 检出失败 java.lang.InterruptedException .java:395) 在 hudson.Proc$LocalProc.join(Proc.java:325) 在 hudson.Proc.joinWithTimeout(Proc.java:171) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java: 2423) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81) 在 org.jenkinsci.plugins.gitclient. CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569) 在 hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:907) 在 hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1131) 在 hudson.plugins。 git.GitSCM.checkout(GitSCM.java:第1167章.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:69) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303) at hudson.model.ResourceController.execute(ResourceController.java :97) 在 hudson.model.Executor.run(Executor.java:427) 错误:已达到最大检出重试次数,正在中止job.WorkflowRun.run(WorkflowRun.java:303) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) 错误:已达到最大检出重试次数,中止job.WorkflowRun.run(WorkflowRun.java:303) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) 错误:已达到最大检出重试次数,中止

在 docker 日志中“警告 ojpwflow.FlowExecutionList#unregister:

所有者 [asif_copy_test_convo_on_devstack_before_build/1:asif_copy_test_convo_on_devstack_before_build #1] 不在列表中:[]”

在此处输入图像描述

标签: jenkins-pipelinejenkins-pluginsjenkins-groovyjenkins-job-dsl

解决方案


您包含的 UI不是用于定义要构建的分支,它是 Job 配置的一部分。

使用上面的 GUI,你告诉 Jenkins 你的工作是一个流水线工作,它需要运行一个 Jenkinsfile。Jenkins 需要从源代码控制 (git) 获取 Jenkinsfile,因此它需要知道如何从那里获取该文件。在此 GUI 中,您可以定义它。存储库位于您提供的 URL 中,凭据与提供的一样,分支名称为*/asif_imap_ev2-...,存储库中 Jenkinsfile 的路径为“Jenkinsfile”(例如,文件位于存储库根目录)。Jenkins 尝试根据上述说明检查 Jenkinsfile 并失败,可能是因为分支名称无效(它包含*/)。


推荐阅读