How to Execute this below code in paralley.. please help iam new to jenkins.
parallel firstBranch: {
node{
newman run xyz.json
}
},
secondBranch:{
node{
newman run xyz123.json
}
}
},
failFast: true|false
为此,我在错误以下得到提示: 另外:
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.cancel(CpsBodyExecution.java:244)
at org.jenkinsci.plugins.workflow.steps.BodyExecution.cancel(BodyExecution.java:76)
at org.jenkinsci.plugins.workflow.cps.steps.ParallelStepExecution.stop(ParallelStepExecution.java:67)
at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.checkAllDone(ParallelStep.java:147)
at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.onFailure(ParallelStep.java:134)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:349)
at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)
答案 0 :(得分:0)
尝试Jenkins文档实例,单击下面的链接:
Parallel stages with Declarative Pipeline 1.2
与詹金斯结交新朋友很容易
{
"name": "postman-newman-jenkins",
"version": "1.0",
"description": "Project postman test",
"directories": {
"test": "tests"
},
"scripts": {
"api-tests-production": "newman run postman_collection.json --reporters cli,html --reporter-html-export ${Environment}-$BUILD_NUMBER-newman.html --reporter-html-template template.hbs
},
"author": "me or you",
"dependencies": {
"newman": "^3.5.2"
}
}
在詹金斯身边
try {
sh 'npm install'
sh 'npm run newman-test'
}
catch (Exception err) {
currentBuild.result = 'UNSTABLE'
}
存档报告
archiveArtifacts'jenkins / $ {Environment}-$ BUILD_NUMBER-newman.html'
最后,您可以格式化此代码以遵守声明性管道代码