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: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com]
On Behalf Of Slide
Sent: Wednesday, January 07, 2015 7:59 AM
To: jenkins...@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 <sub...@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-use...@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.
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-use...@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.
For more options, visit https://groups.google.com/d/optout.