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

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3e3e11d0-beb7-4e67-8d55-ae9c4221549d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to