I am currently investigating usage of Jenkins pipeline script library looking at https://jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/ https://www.cloudbees.com/blog/jenkins-workflow-using-global-library-implement-re-usable-function-call-secured-http-endpoint and https://github.com/jenkinsci/workflow-cps-global-lib-plugin
Do anyone have good examples of global scripts? I found one real-world good source (e.g. not simple hello-world functions) in: https://github.com/fabric8io/jenkins-workflow-library/ - but would appreaciate even more sources. Especially I am wondering if it's possible to pass a Map of arguments as well as a Closure to my function in vars/myFunction.groovy - as this would give the flexibility to pass config + body-closure, so that I can define some pre- and post- steps before and after the closure runs, using the passed configuration. The examples I find in https://github.com/fabric8io/jenkins-workflow-library/ all use the method body for passing parameters - thus leaving no "space" for a closure. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f335be66-f8bf-4c9f-967b-c3828f799fab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
