Hi all,
I have this piece of code
def s
def workspace
pipeline {
agent { label 'build_1804' }
stages {
stage('load functions') {
steps {
script{
workspace = env.WORKSPACE
node('build_1804') {
s = load "${workspace}/regress/Jenkins_extension.groovy"
}
}
}
}
stage('Build and Test 1') {
steps{
script{
s.buildandtest1(this)
}
}
}
}
}
And other file with:
def buildandtest1(Object s) {
parallel {
echo "Building test"
echo "Calling test script..."
sh """
cd regress
echo \"./do_standalone_wo_resnet50_2_58.sh\"
"""
}
}
}
}
Dont put too much attention in {} or other syntax errors, i have modified the code to do it more readable.
The main problem is that seems that jenkins is not able to start "parallel" stages when it is called from a method. I am getting this error.
java.lang.IllegalArgumentException: Expected named arguments but got org.jenkinsci.plugins.workflow.cps.CpsClosure2@6a6de064
at org.jenkinsci.plugins.workflow.cps.DSL.singleParam(DSL.java:718)
at org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:706)
at org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:640)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:234)
I have googled, but i dont find any solution or clue to fix it.
What am i missing ?