Hi,
I have (locally) Jenkins 2.49 and Job DSL 1.58 and Groovy version 2.4.8
I need a way to iterate files in a folder to load configuration (multiple files) from it.
Following code does not work using Job DSL:
a) you need WORKSPACE to build absolute path
The normal Groovy code new File("config").getAbsolutePath() does not work (with groovyConsole all fine)
b) isDirectory prints out "false" also normal groovy code says "true". (with groovyConsole all fine)
println(GroovySystem.version)
def path = new File(WORKSPACE + "/config").getAbsolutePath()
println("info (path) : " + path)
println("info (isDirectory) : " + new File(path).isDirectory())
Output:
+ mkdir -p config
Processing provided DSL script
2.4.8
info (path) : /data/jenkins/local/workspace/TMP/config
info (isDirectory) : false
Any help is appreciated ...
kind Regards,
Thomas