Issue Type: Improvement Improvement
Affects Versions: current
Assignee: Alex Earl
Components: email-ext
Created: 05/Jan/14 7:44 AM
Description:

Please add "shell" variable into GroovyShell context used to run "pre-send" script (see the patch).

This will make possible to "source" external SAME groovy pre-send script from many projects, like this:

shell.evaluate("/usr/local/jenkins/pre-send.groovy")

diff --git a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
index 72a9354..e39150e 100755
— a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
+++ b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
@@ -404,6 +404,7 @@ public class ExtendedEmailPublisher extends Notifier implements MatrixAggregatab
binding.setVariable("triggered", ImmutableMultimap.copyOf(context.getTriggered()));

GroovyShell shell = new GroovyShell(cl, binding, cc);
+ binding.setVariable("shell", shell);
StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);

Project: Jenkins
Labels: pre-send
Priority: Trivial Trivial
Reporter: Mike Dubman
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" 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.

Reply via email to