Pergunta

I am using Jenkins for our Maven/Tycho project and I am using Email-ext plugin to get the build reports in email. I am using a jelly script that I found here.

What I am looking for is to be able to add module build results (failed, successful, etc) instead of the build artifacts. Basically I'd like to include the table in the middle of the maven project build in my email. I looked in many places but all I found is test results or artifacts. But I'd like to get the module build result instead.

Foi útil?

Solução

The problem was solved by modifying the artifacts table section like this:

 <!-- MAVEN ARTIFACTS -->
 <j:set var="mbuilds" value="${build.moduleBuilds}" />
 <j:if test="${mbuilds!=null}">
  <div class="content">
    <h1>Module Builds</h1>
    <TABLE>
  <TR><TD class="bg1"><B>Bundle Name</B></TD>
<TD class="bg1"><B>Build Result</B></TD></TR>
  <j:forEach var="m" items="${mbuilds}">
    <tr>
<TD>${m.key.displayName}</TD>
<j:if test="${m.value==null or m.value.size()==0 }">
    <td>didn't run</td>

</j:if>
    <j:forEach var="mvnbld" items="${m.value}">
<td>${mvnbld.result}</td>
<td align="left"> 
        <j:choose>
          <j:when test="${mvnbld.result=='SUCCESS'}">
            <img src="${rooturl}static/e59dfe28/images/16x16/blue.gif" />
          </j:when>
          <j:when test="${mvnbld.result=='FAILURE'}">
            <img src="${rooturl}static/e59dfe28/images/16x16/red.gif" />
          </j:when>
      <j:when test="${mvnbld.result=='NOT_BUILT'}">
            <img src="${rooturl}static/e59dfe28/images/16x16/grey.gif" />
          </j:when>
      <j:when test="${mvnbld.result=='UNSTABLE'}">
            <img src="${rooturl}static/e59dfe28/images/16x16/yellow.gif" />
          </j:when>
          <j:otherwise>
            <img src="${rooturl}static/e59dfe28/images/16x16/grey.gif" />
          </j:otherwise>
        </j:choose>
      </td>
    </j:forEach>

</tr>
  </j:forEach>
 </TABLE>
    <br />
  </div>
 </j:if>

The main issue is however, the java docs are not good enough for jelly script or groovy implementation. I had to randomly try things because for instance you cannot find getModuleBuilds in the AbstractBuild api.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top