I am trying to use the following code to complete assemblies and, in the end, perform post-assembly actions when the assemblies were successful. However, I get a MultipleCompilationErrorsException, saying that my try block is not a valid section definition. Help, I tried to reorganize the block a lot, but it seems I can not solve the problem.
pipeline{
agent any
try {
stages{
stage("Parallel 1") {
steps {
parallel (
'firstTask' : {
build( "DSL-Controll-Demo-Fibonacci-1" )
},
'secondTask' : {
build( "DSL-Controll-Demo-Fibonacci-2" )
}
)
}
}
stage("Feature") {
steps {
build( "DSL-Controll-Demo-Fibonacci-5" )
build( "DSL-Controll-Demo-Fibonacci-6" )
}
}
stage("Parallel 2") {
steps{
parallel (
"thirdTask" : {
build( "DSL-Controll-Demo-Fibonacci-3" )
},
"forthTask" : {
build( "DSL-Controll-Demo-Fibonacci-4" )
}
)
}
}
}
}
catch(all) {
currentBuild.result = 'FAILURE'
}
if(currentBuild.result != 'FAILURE') {
stages{
stage("Post Build") {
steps {
build("DSL-Controll-Demo-Fibonacci-7")
}
}
}
}
}
source
share