jenkins-pipeline - 非主分支未在 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] 不在列表中:[]”
解决方案
您包含的 UI不是用于定义要构建的分支,它是 Job 配置的一部分。
使用上面的 GUI,你告诉 Jenkins 你的工作是一个流水线工作,它需要运行一个 Jenkinsfile。Jenkins 需要从源代码控制 (git) 获取 Jenkinsfile,因此它需要知道如何从那里获取该文件。在此 GUI 中,您可以定义它。存储库位于您提供的 URL 中,凭据与提供的一样,分支名称为*/asif_imap_ev2-...
,存储库中 Jenkinsfile 的路径为“Jenkinsfile”(例如,文件位于存储库根目录)。Jenkins 尝试根据上述说明检查 Jenkinsfile 并失败,可能是因为分支名称无效(它包含*/
)。
推荐阅读
- mysql - 加入3个表,包括空值Mysql
- angular - 如何解决“日期”不是实例日期问题?
- javascript - 在点击事件上更改 `minicolors()` 的值
- javascript - 如何在 react-redux 上混合数组?
- c# - 如何修复 Entity Framework Core 错误“值不能为空。参数名称:frameworkName”?
- java - 修复 switch multiple case 语句
- python - 如何通过移动直线获得斜率?
- wordpress - 如何使用 Wordpress Gutenberg 为自定义帖子类型添加元框
- nested - BigQuery 更新多个嵌套列
- java - 保护 PDF 文件和 PDFBox 中的“saveIncremental”