Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the instance variables coming from on the email-ext jelly/groovy scripts?

The templates and examples provided by the email-ext plugin on jenkins reference variables such as build, root, it, etc.... Where are these variables coming from and where is the documentation on them? I understand to some extent that it is the reference to the plugin instance, but that's about where my understanding ends.

If you need reference to the scripts you can see some examples here: https://github.com/jenkinsci/email-ext-plugin/tree/master/src/main/resources/hudson/plugins/emailext/templates

like image 710
AgentRegEdit Avatar asked Apr 02 '12 16:04

AgentRegEdit


People also ask

How to use email ext plugin in Jenkins?

For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.

Which of the following is a function of the email ext plugin?

The email-ext plugin uses tokens to allow dynamic data to be inserted into recipient list, email subject line or body.

What is pre send script in Jenkins?

The pre-send script provides a variable named "build", which is of a type that inherits from AbstractBuild.


1 Answers

build: hudson.model.AbstractBuild - your build instance.

project == build.getParent() - the job instance for your build.

it: ScriptContentBuildWrapper(build) (internal ExtEmail class)

rootUrl Jenkins URL as set in your Jenkins configuration

template: template name

Here is EmailExt plugin code link. What you are looking for is in the method ScriptContent.createEngine().

For reference, here is Jenkins API link.

like image 163
malenkiy_scot Avatar answered Sep 22 '22 20:09

malenkiy_scot