-
New Feature
-
Resolution: Won't Fix
-
Blocker
-
None
The jobdsl plugin documentation mentions that it is possible to use shared libraries:
Despite of multiple searches I haven't found a way to use jobdsl with configured additional classpath. More over the configuration as code part brings some more constraints too. All references point to other mechanism which is a pipeline with a jobdsl step.
While it is said to do things in such a way it rather sounds like a workaround which multiply amount of jobs/configurations carried for basic scenarios. Effectively this approach double amount of configurations.
Hence my proposal is to introduce a new option for jobdsl CASC which would allow to configure classpath elements used for bootstrapped jobs and finally let them utilize advertised real word example:
jobs: - additionalClasspath: ['/var/jenkins_home/lib/', 'abc/', 'def/'] - script: > job('testJob1') { scm { git('git://github.com/quidryan/aws-sdk-test.git') } triggers { scm('H/15 * * * *') } steps { maven('-e clean test') } } - file: ./src/test/resources/javaposse/jobdsl/plugin/testjob.groovy - file: ./src/test/resources/javaposse/jobdsl/plugin/advancedJob.groovy