Hi,
I have created a groovy script which imports a script form the resource folder.
The src script looks like below:
############
package example
import javaposse.jobdsl.dsl.*
.........................................
class MyClass {
String name
String remoteFile = 'resources/common/groovy/pipelines/codeBuld/v1.groovy'
Job build(DslFactory dslFactory) {
dslFactory.pipelineJob(name) {
.........................................
definition {
cps {
script(readFileFromWorkspace(remoteFile))
sandbox()
}
}
############
When the seed job tries to create the jobs I get the error:
ERROR: (MyClass.groovy, line 45) No signature of method: javaposse.jobdsl.dsl.helpers.workflow.CpsContext.readFileFromWorkspace() is applicable for argument types: (java.lang.String) values: [resources/common/groovy/pipelines/codeBuld/v1.groovy]
I am not sure what I am doing wrong. Can I have some help please?
I get the same error on:
- Jenkins 2.32, 2.46.3 and 2.65
- Job DSL 1.63
Many thanks