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

Gou*_*nda 6 jenkins jenkins-pipeline

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

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

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

grovvy script : 
    parallel firstBranch: {
        node('master'){
            echo 'firstBranch'
        }
    }, 
    secondBranch: {
        node('slave1'){
            echo 'secondBranch'
        }
    }
Run Code Online (Sandbox Code Playgroud)

注意:master和slave1是我的节点

什么是firstBranch和secondBranch理想的????

控制台输出:

用户匿名[Pipeline] parallel [Pipeline] [firstBranch] {(Branch:firstBranch)[Pipeline] [secondBranch] {(Branch:secondBranch)[Pipeline] [firstBranch] node [firstBranch]在master中运行/ scratch/gnithyan /.hudson/workspace/pipeline_test
[Pipeline] [secondBranch] node
[Pipeline] [secondBranch] // node
[Pipeline] [secondBranch]}
[secondBranch]分支secondBranch
[Pipeline] [firstBranch] {
[Pipeline] [firstBranch]失败echo
[firstBranch] firstBranch
[Pipeline] [firstBranch]}
[Pipeline] [firstBranch] // node
[Pipeline] [firstBranch]}
[Pipeline] // parallel
[Pipeline] End of Pipeline

java.lang.IllegalStateException:无法开始写日志在org.jenkinsci.plugins的org.jenkinsci.plugins.workflow.support.actions.LogActionImpl.(LogActionImpl.java:110)的已完成节点org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode [id = 8] .workflow.support.actions.LogActionImpl.stream(LogActionImpl.java:81)at org.jenkinsci.plugins.workflow.support.DefaultStepContex t.get(DefaultStepContext.java:73)位于org.jenkinsci.plugins.workflow.cps.DSL.invokeStep的org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:252)(DSL.java: 179)atg.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)at groovy.lang.GroovyObject $ invokeMethod $ 0.call(未知来源)org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

sab*_*abf 5

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

是的更新PlugIn工作!