如何解决Jenkins Docker Slave Node无法在管道中调用检出
全部, 我有一个Jenkins服务器和一个docker slave节点。现在服务器可以连接到节点并开始运行管道(Jenkinsfile)
我的项目有点特殊,该建筑物依赖于其他项目中的某些代码。因此,在管道中,我添加了一个结帐阶段,如下所示:
**checkout([
$class: 'GitSCM',branches: [[name: '*/master']],gitTool: 'Default',userRemoteConfigs: [[url: 'https://github.com/aaaaaa/bbbbbb.git'],[credentialsId: "${GITHUB_USER_CRED_ID}"]]
])**
Git绝对安装在docker中,我也为此docker节点设置了工具位置。但是管道在此步骤中失败并报告:
java.lang.NullPointerException
at hudson.Util.getDigestOf(Util.java:635)
at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
at jenkins.plugins.git.GitToolChooser.decideAndUseCache(GitToolChooser.java:77)
at jenkins.plugins.git.GitToolChooser.<init>(GitToolChooser.java:58)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:850)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:833)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1240)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE.
出什么问题了?有人看到过这个问题,知道如何解决吗?提前非常感谢您!
解决方法
这与Git插件的最新版本中引入的与性能相关的功能有关。我使用v4.4.1。复制。更改签出语法以定义一个userRemoteConfig而不是两个来解决此问题(更多详细信息:https://issues.jenkins-ci.org/browse/JENKINS-61608)。如果后者不能为您解决此问题,请降级插件,或在“配置系统”的“ Git插件”部分中选中“禁用性能增强”。此设置可在此处控制有关新功能的更多信息:https://plugins.jenkins.io/git/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。