I tried using the steps variable in my pipeline library (also tried passing the "this" reference), but I can't seem to get it working properly due to some serialization errors. Here's my (redacted) code
If I move the jobDsl() call to the pipeline script with some ugly code crafting, then it seems to be working (although still very annoyingly with script approvals for each update type).
BTW: Adding the @NonCPS annotation on the updateJenkinsJob doesn't seem to make a difference as well.
Comments
1 comment
Hi,
I tried using the steps variable in my pipeline library (also tried passing the "this" reference), but I can't seem to get it working properly due to some serialization errors. Here's my (redacted) code
And my pipeline script in Jenkins (with or without sandbox tick) is:
For some reason I keep getting following exception
At first I thought it was related to the "jobDsl" step (https://www.jenkins.io/doc/pipeline/steps/job-dsl/) using the hudson.model.Hudson class, however when digging into https://github.com/jenkinsci/job-dsl-plugin I can't find any reference to that class. So it must be related to the usage of "steps" (in my limited vision on Jenkins)
If I move the jobDsl() call to the pipeline script with some ugly code crafting, then it seems to be working (although still very annoyingly with script approvals for each update type).
BTW: Adding the @NonCPS annotation on the updateJenkinsJob doesn't seem to make a difference as well.
Any clues on this?
Please sign in to leave a comment.