OK, I'll try to do it the way you offer, thanks :)

On Thursday, August 15, 2013 5:17:24 PM UTC+3, slide wrote:
>
> The templates actually ARE Groovy embedded into "other stuff" they are 
> SimpleTemplateString's, so you can look at 
> http://groovy.codehaus.org/Groovy+Templates for information on the syntax 
> and capabilities. Avihay needs to revert to the original template he had, 
> but NOT specify a script parameter, just the template parameter.
>
> ${SCRIPT, template="your-template.template"}
>
>
> On Thu, Aug 15, 2013 at 3:10 AM, Daniel Beck <m...@beckweb.net<javascript:>
> > wrote:
>
>> Groovy files aren't Groovy embedded in HTML/XML and don't use <% %>.
>>
>> On 15.08.2013, at 11:53, Avihay Eyal <aviha...@gmail.com <javascript:>> 
>> wrote:
>>
>> > Thanks a lot, it helped. My default content now is:
>> > ${SCRIPT, script="send_email.groovy",template="groovy-html.template"}
>> >
>> > But it seems that I have an error in my groovy, cause in the email I 
>> receive the following error:
>> >
>> > Error in script or template: 
>> org.codehaus.groovy.control.MultiplrComplicatioErroresException: startup 
>> failed: Script1.groovy: 1: unexpected token:<@line 1, column 1.<%^1 error
>> >
>> > I'm not familiar with groovy at all, so if you can help with that it 
>> would be great.
>> >
>> > This is the code I copied from you:
>> >
>> > <%
>> >         // the goal is to find the top level job which should contain 
>> the changelist
>> >         def upstreamBuild = null
>> >     def cause = build.causes.find {
>> >         if(it instanceof hudson.model.Cause.UpstreamCause) {
>> >             return true
>> >         }
>> >         return false
>> >     }
>> >
>> >     while(cause != null) {
>> >         upstreamBuild =
>> > 
>> hudson.model.Hudson.instance.getItem(cause.upstreamProject).getBuildByNumber(cause.upstreamBuild)
>> >         cause = upstreamBuild.causes.find {
>> >             if(it instanceof hudson.model.Cause.UpstreamCause) {
>> >                 return true
>> >             }
>> >             return false
>> >         }
>> >     }
>> > %>
>> >     <!-- CHANGE SET -->
>> > <%
>> >         if(upstreamBuild != null) {
>> >            // now do stuff with that upstream build
>> >        }
>> > %>
>> >
>> > On Thursday, August 15, 2013 9:42:38 AM UTC+3, Daniel Beck wrote:
>> > Your syntax is wrong (while the linked thread got it right). Quoting 
>> the first line in the 'Content Token Reference' (which should probably be 
>> bold and blinking):
>> >
>> > > All arguments are optional. Arguments may be given for each token in 
>> the form name="value" for strings and in the form name=value for booleans 
>> and numbers.
>> >
>> > So you should try ${SCRIPT, script="send_email.groovy", 
>> template="template"} instead.
>> >
>> > Regarding templates provided with email-ext:
>> >
>> > - In older Jenkins versions, they're in 
>> $JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/
>> > - In newer Jenkins versions, they're in the archive at 
>> $JENKINS_HOME/plugins/email-ext/WEB-INF/lib/classes.jar (it's just a zip 
>> file, extract it somewhere) in hudson/plugins/email-ext/templates/
>> >
>> > On 15.08.2013, at 07:07, Avihay Eyal <aviha...@gmail.com> wrote:
>> >
>> > > Hi, I saw the following posts:
>> > > 
>> https://groups.google.com/forum/#!searchin/jenkinsci-users/slide$20groovy$20template/jenkinsci-users/Juu2LfRkgck/G091xZI24UgJ
>> > >
>> > > So what I did:
>> > >
>> > > 1. create a directory named email-templates under /var/lib/jenkins 
>> (wasn't there suppose to be a email-template dir already?)
>> > > 2. Renamed the script you wrote to send_email.groovy, and copied it 
>> to /var/lib/jenkins/email-templates
>> > > 3. replaced the Default content with ${SCRIPT, "send_email.groovy", 
>> "template=template"}.(ddin't copy any template to email-template dir, as I 
>> didn't find none under my ext-email plugin.
>> > >
>> > > When I ran it, all I got was ${SCRIPT, "send_email.groovy", 
>> "template=template"} as the email content...That's the same as the guy that 
>> asked you before, but I don't know how to solve it...
>> > >
>> > >
>> > > Thanks.
>> > >
>> > >
>> > > On Wednesday, August 14, 2013 6:40:38 PM UTC+3, slide wrote:
>> > > I believe I posted on this before, the easiest thing might be to have 
>> a job that runs after project C that follows the upstream chain and just 
>> summarizes via a groovy template. If you search the archives, I think I've 
>> posted the code on how to access upstream builds and so forth.
>> > >
>> > > slide
>> > >
>> > >
>> > > On Wed, Aug 14, 2013 at 7:22 AM, Avihay Eyal <aviha...@gmail.com> 
>> wrote:
>> > > Hi, I'm using Email-ext to send email once a job is done.
>> > >
>> > > I would like that email to have results of the upstream projects as 
>> well (project A->project B->project C, ad I want
>> > > an email summarizing A,B,C). I could send three emails from the three 
>> different projects, but that seems messy to me...
>> > >
>> > >
>> > > What's the best way to go about it?
>> > >
>> > >
>> > > Thanks.
>> > >
>> > > --
>> > > 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 jenkinsci-use...@googlegroups.com.
>> > > 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 jenkinsci-use...@googlegroups.com.
>> > > 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 jenkinsci-use...@googlegroups.com <javascript:>.
>> > 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 jenkinsci-use...@googlegroups.com <javascript:>.
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to