Jenkins Extended E-mail不会打印$ GIT_BRANCH或$ GIT_COMMIT [英] Jenkins Extended E-mail won't print $GIT_BRANCH or $GIT_COMMIT
问题描述
< table border =0我在环境变量名称周围尝试了{},对输出没有任何影响。 >
< tr>< td>< b>项目:< / b> < / TD>< TD> < b取代; $ PROJECT_NAME< / B>< / TD>< / TR>
< tr>< td> Build#:< / td>< td> $ BUILD_NUMBER< / TD>< / TR>
< tr>< td>状态:< / td>< td> $ BUILD_STATUS< / TD>< / TR>
< tr>< td> Git reversion#:< / td>< td> $ GIT_COMMIT< / TD>< / TR>
< tr>< td> Git分支:< / td>< td> $ GIT_BRANCH< / TD>< / TR>
< tr>< td>变更:< / td>< td> $变更< / TD>< / TR>
< / table>
我检查这些环境变量是否存在于构建命令行输出中。为什么他们不会出现在电子邮件中?
构建变量,如 $ PROJECT_NAME
和 $ BUILD_NUMBER
可直接使用,因为它们是在此构建会话中创建的。
对于环境变量,您必须使用以下语法:
$ {ENV,var =GIT_COMMIT}
In the Jenkins "Extended E-mail Notification" plugin, I have created a table about the Build and Git reversion numbers, getting the values through the environment variables that Jenkins sets. All of the table entries are fine apart from the $GIT_COMMIT & $GIT_BRANCH parts. It outputs the strings "$GIT_COMMIT" & "$GIT_BRANCH" respectively. I tried using {} around the environment variable name, with no effect on the output.
<table border="0">
<tr><td><b>Project:</b> </td><td> <b>$PROJECT_NAME</b></td></tr>
<tr><td>Build #: </td><td> $BUILD_NUMBER</td></tr>
<tr><td>Status: </td><td> $BUILD_STATUS</td></tr>
<tr><td>Git reversion #: </td><td> $GIT_COMMIT</td></tr>
<tr><td>Git branch: </td><td> $GIT_BRANCH</td></tr>
<tr><td>Changes: </td><td> $CHANGES</td></tr>
</table>
I check that these environment varables exist at the build command line output. Why do they not appear in the email?
Build variables, like $PROJECT_NAME
and $BUILD_NUMBER
are available directly, since they are created in this build session.
For environment variables, you have to use the following syntax:
${ENV, var="GIT_COMMIT"}
这篇关于Jenkins Extended E-mail不会打印$ GIT_BRANCH或$ GIT_COMMIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!