Skip to content

Instantly share code, notes, and snippets.

@junxy
Last active January 11, 2017 11:39
Show Gist options
  • Select an option

  • Save junxy/cc9951250326101779a9 to your computer and use it in GitHub Desktop.

Select an option

Save junxy/cc9951250326101779a9 to your computer and use it in GitHub Desktop.
Jenkins Email Template Jelly 中获取当前环境变量 build git branch
<tr>
<td style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
Branch:
</td>
<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<j:set var="branch" value="${buildenv.get('GIT_BRANCH')}"/>
<td style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
${branch}
</td>
</tr>

Jenkins Email Template Jelly 中获取当前环境变量 build git branch

<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<j:set var="branch" value="${buildenv.get('GIT_BRANCH')}"/>

${branch}

Environment variables The git plugin sets several environment variables you can use in your scripts: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

ref:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment