Jenkins EnvInject 插件 + 流水线作业 [英] Jenkins EnvInject plugin + Pipeline job

查看:44
本文介绍了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?

推荐答案

如果您在属性内容"块中声明了以下变量:

If you declared following variables in "Properties Content" block:

param1=value1
param2=value2

然后你可以在这里将它们放入管道中:

Then you can get them into pipeline here so:

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

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

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