Jenkins Workflow Plugin Using a Groovy Library

喜欢而已 提交于 2019-12-04 14:59:50

You can use Global Lib as pointed in other comments and/or use the load step to load you own scripts from somewhere (i.e. your SCM just checked out previously).

More info about load: https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#triggering-manual-loading

This is what the Workflow Global Library is for! https://github.com/jenkinsci/workflow-plugin/blob/master/cps-global-lib/README.md I use this in my installation, it's a great feature of Workflow. Right now I just have one "helper" class that contains methods common to all builds, but as other teams start to adopt Workflow they are showing interest in creating their own classes to use for subsets of our builds.

I've actually got this working in the end by using our own git repo but putting a symlink into workflow-libs/src to point at that repo.

The Workflow Remote File Loader plugin might meet your needs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!