#Jenkins email-ext command stdout in email

Oscar Brito


If you're using email-ext plugin for Jenkins and you want to execute a command while your email notification is being processed, you can include into your groovy template something like:

<% 
def cmd = "cmd /c cd " + build.getWorkspace() + " && svn diff -r HEAD"
print cmd.execute().text
%>

In this example I'm including the latest svn diff in the email. Don't forget that jenkins truncates the email content if its size is bigger than a certain value...

This type of things can be very handful to make your notifications more informative.







Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.