Jenkins:将部署的工件添加到邮件分机模板
Jenkins: Add deployed artifacts to mail-ext template
我们使用 ArtifactDeployer plugin to copy some files on a remote location. Is it possible to include the download links to our mail-ext 邮件模板?
我摆弄了一下 HTML 果冻模板,但我无法让它工作。
谢谢
经过一番挖掘,设法想出了这个:
<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/>
我们使用 ArtifactDeployer plugin to copy some files on a remote location. Is it possible to include the download links to our mail-ext 邮件模板?
我摆弄了一下 HTML 果冻模板,但我无法让它工作。
谢谢
经过一番挖掘,设法想出了这个:
<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/>