How can I execute Jenkins buildstep "Process Job DSLs " and use "Look on Filesystem" dsl files in some workspace subdirectory and use readFileFromWorkspace() with filepath in other workspace subdirectory
Example:
- workspace( Jenkins)
- scripts
- start.groovy
- project1
- dsls
- dsl1.dsl
- dsl2.dsl
If I add the following filepaths in "Process Job DSLs " - "Look on Filesystem" dialog box:
project1/dsls/dsl1.dsl
project1/dsls/dsl2.dsl
and in, for example dsl1.dsl, I use the following file fragment and place start.groovy in workspace/scripts directory:
...
steps {
systemGroovyCommand(readFileFromWorkspace('scripts/start.groovy'))
}
...
then the DSL process step will fail and say that the file is not found!!
- workspace( Jenkins)
- project1
- dsls
- dsl1.dsl
- dsl2.dsl
If I instead move the start.groovy script to workspace/project1/dsls/scripts it works!!
But the question is how can I access files that does not have DSL Root as root, the name of the function "readFileFromWorkspace()" indicates that it fetches from workspace and not from DSL Root?