location of email-ext template file

瀏覽次數:4,397 次
跳到第一則未讀訊息

esharish

未讀,
2015年3月1日 清晨5:59:522015/3/1
收件者:jenkins...@googlegroups.com
I can use the default html template from email-ext plugin, but I cannot locate the template file under the plugin directory or Jenkins home to edit it. Where can I edit this default html.jelly template? I am using latest Jenkins 1.598 and email-ext template 2.39.

Slide

未讀,
2015年3月1日 上午10:05:452015/3/1
收件者:jenkins...@googlegroups.com

Check the wiki, there is information there on that exact thing.


On Sun, Mar 1, 2015, 03:59 esharish <hari...@gmail.com> wrote:
I can use the default html template from email-ext plugin, but I cannot locate the template file under the plugin directory or Jenkins home to edit it. Where can I edit this default html.jelly template? I am using latest Jenkins 1.598 and email-ext template 2.39.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/96e7e9f6-d4c9-4e77-8ca7-00bdce9462da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harish ES

未讀,
2015年3月1日 上午10:42:072015/3/1
收件者:jenkins...@googlegroups.com
Thanks Slide, from reading plugin wiki, it looks I need to make a copy of jelly template(from github?) with custom name and edit it and follow below steps pasted from wiki:

Using custom Jelly scripts (those not packaged with email-ext) requires the cooperation of your Hudson administrator. The steps are relatively simple:

  1. Create the Jelly script. The name of the script should be <name>.jelly. It is important the name ends in .jelly.
  2. Have your Jenkins administrator place the script inside $JENKINS_HOME_\email-templates_.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/_FgZG06aqGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVchzFuyQHWuw4-CsxqZ-tjSuGxteE9xZkMkWaJX%3DAcKcw%40mail.gmail.com.

Slide

未讀,
2015年3月1日 下午4:16:192015/3/1
收件者:jenkins...@googlegroups.com
The other option is if you install the config-file-provider plugin, you can put the template in there and not have to worry about using the file system location. I need to go and update the wiki with a bunch of information...

Chris T

未讀,
2017年12月6日 中午12:24:462017/12/6
收件者:Jenkins Users
And how is "config-file-provider" used?

In the emailext:
body: '${JELLY_SCRIPT, template="managed:<name_of_my_config_file>"}',
or
body: '${SCRIPT, template="managed:<name_of_my_config_file>"}',

But this isn't working for me.

Slide

未讀,
2017年12月6日 中午12:25:552017/12/6
收件者:jenkins...@googlegroups.com
Do you have the config-file-provider plugin installed? If so, you specify the NAME of the template that you create in the managed scripts area of the global configuration after managed:

Chris T

未讀,
2017年12月6日 下午2:27:252017/12/6
收件者:Jenkins Users
Thanks slide on the fast response!
So yes I do have config-file-provider plugin installed.
I've attached screenshots of screenshots of my set up.

In my pipeline Jenkinsfile, I would add:
                emailext(
                    to: '<an_email>',
                    subject: 'test email',
                    body:'${JELLY_SCRIPT, template="managed:JellyEmailTemplate.jelly"}' ,
                    mimeType: 'text/html'
                )

But the email response would say:

Jelly file [managed:JellyEmailTemplate.jelly] was not found in $JENKINS_HOME/email-templates.


Do you know why the pipeline doesn't pick up my config files?
Config File Page.JPG
Config File.JPG

Slide

未讀,
2017年12月6日 下午3:01:422017/12/6
收件者:jenkins...@googlegroups.com
Just for kicks, can you try removing .jelly from the name of the template?

jer...@bodycad.com

未讀,
2017年12月6日 下午3:08:432017/12/6
收件者:Jenkins Users
For security reason I was told, the template must reside on the master (you can stash it and unstash it into the email template folder on the master or you can read it and write it on master node):

node('master')
{
  writeFile([file: "${JENKINS_HOME}/email-templates/mytempofile.jelly", text: 'template data read from other file']);
}
emailext body: ...

At least it was my workaround until I find something less retarded.

Chris T

未讀,
2017年12月6日 下午3:25:502017/12/6
收件者:Jenkins Users
I originally had the template name without ".jelly", but got same (not working) results.

Chris T

未讀,
2017年12月6日 下午3:28:022017/12/6
收件者:Jenkins Users
I thought the point of config-file-provider plugin was so we don't have to store the template in the $JENKINS_HOME/email-templates?

Slide

未讀,
2017年12月6日 下午4:26:122017/12/6
收件者:jenkins...@googlegroups.com
Yes, that is the point. I'm not sure why it isn't working for you, I am using pretty much the same thing in my setup and it works (though I am not sure I have tried from a pipeline job).

--
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.

Daniel Beck

未讀,
2017年12月6日 下午5:02:042017/12/6
收件者:jenkins...@googlegroups.com

> On 6. Dec 2017, at 19:42, Chris T <chris.t...@gmail.com> wrote:
>
> So yes I do have config-file-provider plugin installed.

Have you restarted Jenkins since you installed either of these plugins? Optional features may not be available otherwise.

Chris T

未讀,
2017年12月6日 下午5:28:382017/12/6
收件者:Jenkins Users
The plugins were install a while ago, and have been restarted (at least a few times) since then.

Chris T

未讀,
2017年12月6日 下午5:46:152017/12/6
收件者:Jenkins Users
Just to narrow down possible failure points, I did make a simple free style job where I added in the same command in the default content box of the editable email notification. And got same results as in my pipeline.

Slide

未讀,
2017年12月7日 上午10:44:262017/12/7
收件者:jenkins...@googlegroups.com
Can you try enabling debug mode for email-ext (there is a checkbox in the global config, possibly under advanced) and see if there is anything in the logs that could help pinpoint the issue? Also, I didn't see what versions of Jenkins, email-ext and config-file-provider you are using, can you share that as well?

Chris T

未讀,
2017年12月7日 上午11:29:402017/12/7
收件者:Jenkins Users
I will try that, and for versions:

Jenkins: 2.86

Email ext plugin: 2.60

Config File Provider: 2.16.4

slmp...@gmail.com

未讀,
2018年1月4日 凌晨4:59:072018/1/4
收件者:Jenkins Users
Hi,
    I also getting same error.


Jelly file [managed:EmailTemplate] was not found in $JENKINS_HOME/email-templates.

I already installed

Config File Provider Plugin but i dont't know how to refer in my email template.



in email text


               ${JELLY_SCRIPT, template="managed:EmailTemplate.jelly"}



I also tried


               ${JELLY_SCRIPT, template="managed:EmailTemplate"}



can anyone please help to solve this issue


Mani Agnihotri

未讀,
2018年6月18日 凌晨3:04:022018/6/18
收件者:Jenkins Users
Hi,

I know this is old post, but I figured a lot of people might be struggling from the same problem still (just like I was). The problem is you are probably using the *ID* of the template and not the *Name*. 
  1. Make the name free of whitespaces
  2. Use the name instead of ID
This should solve the issue.

Thanks!

kalkin powale

未讀,
2019年3月27日 上午10:58:042019/3/27
收件者:Jenkins Users
Hi,
I am using groovy scripts and I use this command after adding my template here config-file-provider plugin. and it worked fine.

body: '''${SCRIPT, template="managed:custom_groovy_Email.groovy"}''',
回覆所有人
回覆作者
轉寄
0 則新訊息