-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Hudson 1.343, using email-ext plugin
I suppose this is compatibility problem with the plugin email-ext.
What occurs is the following :
Mail title : 5 » promotion » Promo1 - Build # 5 - Building!
Mail body : 5 » promotion » Promo1 5
email-ext config title : $DEFAULT_SUBJECT
emain-ext config body : $PROJECT_NAME $BUILD_NUMBER
I tried to set a variable like you did with PROMOTED_URL using the following but I failed (Indeed, PROMOTED_URL is not resolved)
In Promotion.java:67
<code>
@Override
public EnvVars getEnvironment(TaskListener listener) throws IOException, InterruptedException
</code>
I added this to prefix the promoted build's environment into the promotion tasks. Then in my emailext config i could use: ${ENV,var="PROMOTED_BUILD_URL"} etc...
Hope this helps, I'd love to see this get added to the mainline..
Index: src/main/java/hudson/plugins/promoted_builds/Promotion.java
{ return getTarget().getAction(PromotedBuildAction.class).getPromotion(getParent().getName()); }===================================================================
— src/main/java/hudson/plugins/promoted_builds/Promotion.java (revision 30880)
+++ src/main/java/hudson/plugins/promoted_builds/Promotion.java (working copy)
@@ -61,10 +61,14 @@
public Status getStatus()
-
{ // append promoted build's env + e.put("PROMOTED_" + key, parentEnv.get(key)); + }+
@Override
public EnvVars getEnvironment(TaskListener listener) throws IOException, InterruptedException {
EnvVars e = super.getEnvironment(listener);
+ EnvVars parentEnv = this.getTarget().getEnvironment(listener);
+ for (String key : parentEnv.keySet())
String rootUrl = Hudson.getInstance().getRootUrl();
if(rootUrl!=null)
e.put("PROMOTED_URL",rootUrl+getTarget().getUrl());