I have this simple pipeline (I'm using a more complex but this one reproduces it):
def test(String name) {
println test
}
pipeline {
agent {
dockerfile {
label "jenkins-lnx-slave3"
args "--user root:root"
dir "CICD"
}
}
stages {
stage ('Test') {
steps {
test(name: 'Hello')
}
}
}
}
And Jenkins is giving me this "No Such DSL method 'test' found" error:
> [Pipeline] } [Pipeline] // withEnv [Pipeline] } [Pipeline] // node
> [Pipeline] End of Pipeline java.lang.NoSuchMethodError: No such DSL
> method 'test' found among steps [ArtifactoryGradleBuild,
This goes on and on for many lines. Am I doing the custom function correctly?
Anyone have any ideas?