The following groovy code in a Groovy Postbuild step produces a file on the 
remote build slave with a property BuildLabel set. Then, before the email-ext 
step, insert a Inject Environment Variables with Properties File Path

// if we are running on a remote slave, we need the channel

if (manager.build.workspace.isRemote()) {
   channel = manager.build.workspace.channel;
}

// create a FilePath object to use to write into the remote workspace

fp = new hudson.FilePath(channel, manager.build.workspace.toString() + 
"\\build.properties")

if (fp != null) {
   String str = "BuildLabel = " + manager.build.getDisplayName();
   fp.write(str, null);
}

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Slide
Sent: Wednesday, January 07, 2015 7:59 AM
To: jenkinsci-users@googlegroups.com
Subject: Re: How do one creates a token in post script Groovy that can be usde 
by Email-Ext?

You would have to inject it into the environment in some way, then you could 
use that item directly.
On Tue Jan 06 2015 at 4:49:06 PM msuberri 
<sube...@gmail.com<mailto:sube...@gmail.com>> wrote:
An example would be greatly appropriated.

Thanks
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/31469e01-09c6-49c5-a3d6-227773c34822%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/31469e01-09c6-49c5-a3d6-227773c34822%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfVE%3DMXB7Jk6zz69-meHs7-sOB_P-oV9mPuXgtb71jdRg%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfVE%3DMXB7Jk6zz69-meHs7-sOB_P-oV9mPuXgtb71jdRg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E26E4DECF7%40AMERMBX02.PERKINELMER.NET.
For more options, visit https://groups.google.com/d/optout.

Reply via email to