Relative Content

Tag Archive for jenkinsgroovyjenkins-pipeline

creating file from groovy code inside Jenkinsfile

I’m trying to create a json file from groovy code that is called from Jenkinsfile. The groovy code seems to work (i.e at the end of the code I list the files in the directory and I see the file is listed there), but when I try try to access that file from a later stage from shell or python then the file isn’t there.

How can I set these options programmatically in a Jenkins multi-branch pipeline?

I have several multi-branch pipeline jobs and I need to set this in all of them. I can point-and-click I know, but how can I set them programmatically in the Jenkins script console? They’re the Branch Sources -> Behaviors block of the job configuration page. I know how to search all the jobs that I need, just want the particular code for these settings. Thanks!