[英]Jenkins “Execute Shell Script” vars needed in post-build action specifically in send email body?
So I set up some vars in Execute Shell Script build action which I would like to use in my post-build action like send email's body. 所以我在Execute Shell Script构建动作中设置了一些变量,我想在我的构建后动作中使用它,比如发送电子邮件的正文。 Is this possible without using any plugins? 这可能不使用任何插件吗? If not possible without plugins what are the plugins that I should use? 如果没有插件不可能,我应该使用哪些插件? Thanks very much, 非常感谢,
Not possible without plugins because: 没有插件是不可能的,因为:
What you need is the EnvInject plugin . 你需要的是EnvInject插件 。
myvar=somevalue
. 在“ 执行Shell脚本”步骤中,不是设置环境变量,而是将键值对写入文件,例如myvar=somevalue
。 You can set any environment variable using the " Generate environment variables from script" by using: echo "MY_VAR=$SOME_VAR" 您可以使用以下命令设置任何环境变量:“使用脚本生成环境变量” :echo“MY_VAR = $ SOME_VAR”
Then this variable is available through the entire jenkins job process. 然后,通过整个jenkins作业流程可以使用此变量。 at any shell/ batch command and even at the mail or any other plugin. 在任何shell / batch命令,甚至在邮件或任何其他插件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.