I need to dynamically modify the notification e-mail recipients based on the build, so I'm using a groovy script. I want this script to be available to all jobs, so I want it to reside on the Jenkins file system and not within each project. It can be either in the recipients fields (using ${SCRIPT,...}) or in the pre-send script. A short (fixed) script that evaluates the master script is also good, as long it is the same for all projects.
You should try Config File Provider plugin. It works together with the Credentials configuration of Jenkins.
Your script will now be saved centrally on Jenkins, available to master/slave nodes.
In your Job Configuration:
myscript
Now, anywhere in your job, you can say ${myscript}
and it will refer to absolute location of the file on filesystem (it will be somewhere in Jenkins dir).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With