问题描述
我已经从配置文件构造了Build版本,并将该版本号值保存到了我的工作空间中的文件中.该文件的内容将包含诸如 2014.4.3.87
I have constructed Build version from a config file and saved this version number value to a file which resides in my workspace.The contents of this file will contain values like 2014.4.3.87
现在,我需要将此值传递给Jenkins电子邮件正文.我已经安装了电子邮件ext插件.我该怎么做.
Now, I need to get this value on to the Jenkins e-mail body.I have email ext plugin installed. How do i do it.
推荐答案
您可以使用shell命令回显文件内容并将其保存到另一个文件中,例如content ="real content"
You can use a shell command echo the file content and save it into a into a another file, like content="real content"
例如:
fileContent="content=$(echo filepath)"
您可以使用env inject插件将此文件"filecontent"作为env注入.
You can use env inject plugin to inject this file "filecontent" as env.
然后在电子邮件ext插件中,尝试使用此插件进行阅读${ENV, var="content"}
在文件内容文本区域
Then inside the email ext plugin, try use this to read it${ENV, var="content"}
in the file content text area
这篇关于从文件获取文本并在Jenkins电子邮件内容中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!