0

We use ArtifactDeployer plugin to copy some files on a remote location. Is it possible to include the download links to our mail-ext mail template?

I fiddled around a bit with the HTML jelly template but I could not get it to work.

Thanks

Ciprian
  • 3,533
  • 1
  • 18
  • 22

1 Answers1

0

After digging around a bit managed to come up with this:

<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/> 
Ciprian
  • 3,533
  • 1
  • 18
  • 22
  • There are some jelly scripts distributed with the plugin. Can't remember if the [html-with-health-and-console.jelly](https://github.com/mfriedenhagen/hudson-email-ext-jelly-templates/blob/master/html-with-health-and-console.jelly) one is also, but you can take a look at the `` section which is pretty much similar to yours :-) – Morfic Apr 24 '15 at 11:29