I believe this was added a month or two ago. On 10 Jan 2018 6:33 pm, "Idan Adar" <[email protected]> wrote:
> Is the following feasible? > > 1. Setup a Shared Library in the Jenkins settings > 2. In every repository requiring the Jenkinsfile (it is the same one used > in multiple repos...), use the following in the Jenkinsfile of the > repository instead: > > (based on https://dev.to/jalogut/centralise-jenkins-pipelines- > configuration-using-shared-libraries) > > @Library("my-shared-library") _ > standardPipeline { > // properties passed to the shared library > } > > 3. In the Shared Library, use this: > > def call(body) { > def config = [:] > body.resolveStrategy = Closure.DELEGATE_FIRST > body.delegate = config > body() > > pipeline { > // the declarative pipeline as-is as it was previously used in a > Jenkinsfile in a repository > } > } > > -- > 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/c878f51d-8097-43fb-a0f5-a95b471f0184%40googlegroups. > com > <https://groups.google.com/d/msgid/jenkinsci-users/c878f51d-8097-43fb-a0f5-a95b471f0184%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAO37hbi18NX6yiGCj8_7AApgY0UTt4Q7_eXJcH26%3DQx9NtWBug%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
