-
Improvement
-
Resolution: Fixed
-
Trivial
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);