Jenkins EnvInject插件+管道工作 [英] Jenkins EnvInject plugin + Pipeline job

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

问题描述

我想在我的管道作业中使用EnvInject插件。因此,我有可能设置复选框为运行准备一个环境,但没有像自由式作业那样的注入环境变量操作。
我在属性内容块中声明了我的变量:

I would like to use EnvInject plugin within my pipeline job. So, I have a possibility to set checkbox "Prepare an environment for the run", but there is no action "Inject environment variables", like in freestyle job. I declared my variables in "Properties Content" block:

如何在管道作业中使用环境变量EnvInject?

How to inject environment variables in pipeline job using EnvInject?

推荐答案

如果您在属性内容块中声明变量:param1 = value1,param2 = value2。

If you declared variables in "Properties Content" block: param1=value1, param2=value2. You can get them into pipeline here so:

//do something
def param1 = env.param1
def param2 = env.param2

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

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