Read DSL from file in Jenkins outside of workspace Read DSL from file in Jenkins outside of workspace jenkins jenkins

Read DSL from file in Jenkins outside of workspace


I recently ran into this very issue: my DSL script was outside of my workspace (installed via a package). The problem is that the DSL Scripts path is an Ant format that only allows specific patterns (and not absolute paths).

My workaround is hacky, but it did work: add an Execute Shell step before the "Process Job DSLs" step that symlinks the external directory into the workspace.

Something like this:

echo "Creating a symlink from /home/flows to workspace"ln -sf "/home/flows" .flows

Then you can set the DSL Scripts path to ".flows/flow_script.dsl".

This has some additional caveats, of course: the directory you're symlinking from will need to be accessible by the jenkins user. And it likely violates a lot of best practices.