Jenkins:将已部署的工件添加到mail-ext模板

时间:2015-04-24 07:01:28

标签: jenkins email-ext artifact-deployer

我们使用ArtifactDeployer插件复制远程位置的某些文件。是否可以将下载链接包含在我们的mail-ext邮件模板中?

我在HTML果冻模板上摆弄了一下,但我无法让它工作。

由于

1 个答案:

答案 0 :(得分:0)

在挖掘了一下之后设法得出了这个:

<j:set var="artifactsDeployAction" value="${it.getAction('org.jenkinsci.plugins.artifactdeployer.ArtifactDeployerBuildAction')}"/>
<j:if test="${artifactsDeployAction!=null}">
  <j:set var="deployedArtifactsInfo" value="${artifactsDeployAction.getDeployedArtifactsInfo()}"/>
  <j:if test="${deployedArtifactsInfo!=null}">

     <j:forEach var="artifactInfo" items="${deployedArtifactsInfo}">
        <j:set var="artifacts" value="${artifactInfo.value}"/>
        <j:if test="${artifacts!=null}">
          <TABLE width="100%">
          <TR><TD class="bg1"><B>DEPLOYED ARTIFACTS</B></TD></TR>
          <TR>
            <TD>
            <j:forEach var="artifact" items="${artifacts}">
               <li>
                  <a href="${rooturl}${build.url}deployedArtifacts/download/artifact.${artifact.id}/">${artifact.fileName}</a>
               </li>
            </j:forEach>
            </TD>
          </TR>
          </TABLE>
        </j:if>
    </j:forEach>
  </j:if>
</j:if>
<BR/>