I use Jenkins pipeline and I want pass String array to local function; i try with a Strinf is ok but not with a String array.
in pipeline::
stage('package') {
steps {
executeModuleScripts(["module1", "module2"])
}
}
at the end of pipeline:
void executeModuleScripts(allModules) {
allModules.each { module ->
String gitFolder = "${module}"
script {
stage(module) {
bat 'xcopy "' + gitFolder + '/foo/*" "temp/PUB/foo" /C /S /I /F /H'
}
}
}
}
I have this error:
groovy.lang.MissingPropertyException: No such property: operation for class: groovy.lang.Binding
question from:https://stackoverflow.com/questions/66066616/jenkins-pipeline-pass-string-array-to-function