Jenkins工作流插件使用Groovy库 [英] Jenkins Workflow Plugin Using a Groovy Library

查看:348
本文介绍了Jenkins工作流插件使用Groovy库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我正在越来越多的Groovy中使用Jenkins Workflow插件时,我已经开始着手使用可用于多个脚本的可重用代码。

As I'm writing more and more Groovy to use with the Jenkins Workflow plugin I've started getting to the point where I've got re-usable code that could be used in multiple scripts.

共享此代码的最佳方式是什么?是否有可能使用共享代码生成我自己的.jar,并在Workflow脚本中使用它?或者有一个更简单的方法吗?

What would be the best way of sharing this code? Is it possible to produce my own .jar with the shared code in and utilize this from within the Workflow script? Or is there a simpler way?

推荐答案

我最终通过使用我们自己的git回购得到了这个工作,一个符号链接到workflow-libs / src中以指向该回购。

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.

这篇关于Jenkins工作流插件使用Groovy库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆