Thanks Eric,

I believe there exists a better solution than using the BuildNameSetterPlugin.

In my Groovy code, I can get access to the build object and then call the 
setDisplayName() method on that. This way, I am in complete control of the code 
that generates the build name and I don't have to do all that BuildNameSettter 
plugin monkey business.

Bob

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Eric Pyle
Sent: Monday, June 24, 2013 2:12 PM
To: jenkinsci-users@googlegroups.com
Subject: Re: Jenkins BuildNameSetterPlugin - timing issue

Hi Bob,

I've been dealing with a similar problem here. According to comments in the 
Build Name Setter plugin code, it checks twice for a value to set the build 
name. I suspect that the first check is before your Groovy script sets the 
parameter, so it doesn't get set until the second check near the end of the 
build. One thought I had was to use the Envinject 
<https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin> plugin, which 
gives a lot more flexibility about when the environment variables are set.

Regards,
Eric
On 6/24/2013 2:05 PM, Bob Bick wrote:
Hi,

Background
Currently, I have a System Groovy script that sets a BUILD_NAME_VAR parameter 
using:

        build.addAction(new ParametersAction(new 
StringParameterValue("BUILD_NAME_VAR";,"${val}")))

The Jenkins BuildNameSetterPlugin uses the BUILD_NAME_VAR variable to generate 
the build name.

Problem
While the build is executing, the name is not correct (i.e. it does not contain 
$BUILD_NAME_VAR). However, after the build completes, then the build name shows 
up correctly (i.e. uses $BUILD_NAME_VAR).

For example, while the build is executing, the Job name shows as:

                #35

And after the build completes, it shows as (assuming BUILD_NAME_VAR = 
"Production build"):

                #35 Production build

Question
Is there a way to set the Job name using a variable (like I am doing); yet, 
have the job name show the same even while the build is executing?

Any suggestions/help would be appreciated.

Thanks,
Bob

*** *** ***
This message contains information which may be confidential and privileged. 
Unless you are the addressee (or authorized to receive for the addressee), you 
may not use, copy or disclose to anyone the message or any information 
contained in the message. If you have received the message in error,  please 
advise the sender by reply e-mail and delete the message.
--
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>.
For more options, visit https://groups.google.com/groups/opt_out.



--
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>.
For more options, visit https://groups.google.com/groups/opt_out.



*** *** ***
This message contains information which may be confidential and privileged. 
Unless you are the addressee (or authorized to receive for the addressee), you 
may not use, copy or disclose to anyone the message or any information 
contained in the message. If you have received the message in error,  please 
advise the sender by reply e-mail and delete the message.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to