My only excuse is mostly my lack of groovy knowledge, and how it would work.
1. I see the .groovy files and .template files, which one's should i use :
${SCRIPT,template="groovy-html.template"}
or:
${SCRIPT,groovy="email-ext.groovy"}
and if we look at jelly vs Groovy:
Jelly ( html.jelly )
<!-- GENERAL INFO -->
<TABLE>
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD><TD valign="center"><B style="font-size: 200%;">BUILD
${build.result}</B></TD></TR>
<TR><TD>Build URL</TD><TD><A
href="${rooturl}${build.url}">${rooturl}${build.url}</A></TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
<BR/>
in Groovy : (groovy-html.template)
<TABLE>
<TR><TD align="right"><IMG SRC="${rooturl}static/e59dfe28/images/32x32/<%=
build.result.toString() == 'SUCCESS' ? "blue.gif" : build.result.toString() ==
'FAILURE' ? 'red.gif' : 'yellow.gif' %>" />
</TD><TD valign="center"><B style="font-size: 200%;">BUILD
${build.result}</B></TD></TR>
<TR><TD>Build URL</TD><TD><A
href="${rooturl}${build.url}">${rooturl}${build.url}</A></TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
Am i missing something, and what do i gain by switching to Groovy, unless the
sample scripts are bad examples. I was sort of Expecting the Groovy to be more
like we Code in Java.
Thanks,
-Kamal.
>________________________________
> From: Slide <[email protected]>
>To: "[email protected]" <[email protected]>
>Sent: Thursday, April 4, 2013 1:09 PM
>Subject: Re: email-ext reporting Branch name
>
>
>Well, is there a reason you aren't doing this in Groovy? It would be orders of
>magnitude easier than trying to do it in Jelly.
>
>
>
>On Thu, Apr 4, 2013 at 9:39 AM, Kamal Ahmed <[email protected]> wrote:
>
>Hi,
>>
>>
>>I want to be able to use jelly script ( Apologize for not doing this in
>>Groovy ) to display the branch name on which the changeset was submitted in
>>subversion.
>>
>>
>>Like , here is a snippet of my custom.jelly
>>
>>
>>The p.path string is :
>>/perlapp/trunk/cgi-bin/developer/smeview/reviewfiles/demo/cui_sample.csv
>>
>>
>>so, i want to extract "perlapp" and "trunk" and display them in the email
>>header.
>>
>>
>>
>>
>>
>>
>> <TD>Build duration:</TD>
>> <TD>${build.durationString}</TD>
>> </TR>
>> <TR>
>> <TD>Branch:</TD>
>> <TD>I want to do a regex here on ${p.path} to extract the first and
>>second string</TD>
>> </TR>
>> </TABLE>
>> <BR />
>> <!-- CHANGE SET
-->
>> <j:set var="changeSet" value="${build.changeSet}" />
>> <j:if test="${changeSet!=null}">
>> <j:set var="hadChanges" value="false" />
>> <TABLE width="100%">
>> <TR>
>> <TD class="bg1" colspan="2">
>> <B>CHANGES</B>
>> </TD>
>> </TR>
>> <j:forEach var="cs" items="${changeSet}" varStatus="loop">
>> <j:set var="hadChanges" value="true" />
>> <j:set var="aUser"
value="${cs.hudsonUser}" />
>> <TR>
>> <TD colspan="2" class="bg2">${spc}Revision
>> <B>${cs.commitId?:cs.revision?:cs.changeNumber}</B>by
>> <B>${aUser!=null?aUser.displayName:cs.author.displayName}:</B>
>> <B>(${cs.msgAnnotated})</B></TD>
>> </TR>
>> <j:forEach var="p" items="${cs.affectedFiles}">
>> <TR>
>>
<TD width="10%">${spc}${p.editType.name}</TD>
>> <TD>${p.path}</TD>
>> --
>>You received this message because you are subscribed to the Google Groups
>>"Jenkins Users" group.
>>To unsubscribe from this group and stop receiving emails from it, send an
>>email to [email protected].
>>For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
>--
>Website: http://earl-of-code.com
--
>You received this message because you are subscribed to the Google Groups
>"Jenkins Users" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to [email protected].
>For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.