gpt4 book ai didi

Jenkins 管道插件如何运行并行任务

转载 作者:行者123 更新时间:2023-12-04 14:56:02 25 4
gpt4 key购买 nike

Jenkins 管道插件如何运行并行任务

我是 jenkins 的初学者,我想使用管道插件在 jenkins 的可用从节点上并行启动一些任务。

我安装了管道插件并在管道内联脚本部分添加了下面的内容。

grovvy script : 
parallel firstBranch: {
node('master'){
echo 'firstBranch'
}
},
secondBranch: {
node('slave1'){
echo 'secondBranch'
}
}

注意 : master 和 slave1 是我的节点

理想情况下 firstBranch 和 secondBranch 是什么????

控制台输出:

Started by user anonymous [Pipeline] parallel [Pipeline] [firstBranch] { (Branch: firstBranch) [Pipeline] [secondBranch] { (Branch: secondBranch) [Pipeline] [firstBranch] node [firstBranch] Running on master in /scratch/gnithyan/.hudson/workspace/pipeline_test
[Pipeline] [secondBranch] node
[Pipeline] [secondBranch] // node
[Pipeline] [secondBranch] }
[secondBranch] Failed in branch secondBranch
[Pipeline] [firstBranch] {
[Pipeline] [firstBranch] echo
[firstBranch] firstBranch
[Pipeline] [firstBranch] }
[Pipeline] [firstBranch] // node
[Pipeline] [firstBranch] }
[Pipeline] // parallel
[Pipeline] End of Pipeline

java.lang.IllegalStateException: cannot start writing logs to a finished node org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode[id=8] at org.jenkinsci.plugins.workflow.support.actions.LogActionImpl.(LogActionImpl.java:110) at org.jenkinsci.plugins.workflow.support.actions.LogActionImpl.stream(LogActionImpl.java:81) at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:73) at org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:252) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:179) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at groovy.lang.GroovyObject$invokeMethod$0.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

最佳答案

我也有同样的问题。也许我找到了依赖插件:
https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Supporting+APIs+Plugin
请参阅版本 2.10 的发行说明
在 2.9 中并行处理某些步骤的日志处理回归。

是的,更新插件有效!

关于Jenkins 管道插件如何运行并行任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40151768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com