Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Hudson » Regarding build number customization for hudson jobs(Build number customization for hudson jobs)
Regarding build number customization for hudson jobs [message #1182280] Tue, 12 November 2013 05:00 Go to next message
Martin Jose is currently offline Martin JoseFriend
Messages: 6
Registered: November 2013
Junior Member
Hi Experts,

We use Hudson job for our daily builds and wanted to have the same build number from SVN as the Hudson job number.

To achieve this we planned to have two separate jobs where the first job do generate the build number and commit that in SVN and the second job do the actual build. So we need to enforce Hudson to use the generated build number as the job number. We tried two options for this,

1) Modified hudson/jobs/job2/nextBuildNumber with the buildnumber value from SVN
This option is not working as it required a Hudson reload to load the properties from Disc. We need to do a manual reload after the first job, which is not possible as we need to add the second job as a dependent job for the first one and trigger it automatically. I even tried a reload using CLI as part of the first job, but then it's not triggering dependent job.

Is there a way to force the second job to load the properties from disc?

2) Used the post-build action "Trigger parameterized build on other projects" option on the first Job and choose the option to add parameters from properties file. Then populated SVN build number in this properties file as property BUILD_NUMBER=number. But still the second job is not picking this number.

Is the property name that I am using is correct?

Kindly let me know if there is better way to do this.

Very much appreciate any help.

Thanks,
Martin
Re: Regarding build number customization for hudson jobs [message #1183308 is a reply to message #1182280] Tue, 12 November 2013 19:42 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
This sounds a very interesting use case. This is the first time I'm hearing some that changing the build number may be useful. Curious, is there any specific reason for doing this?

Winston Prakash
Eclipse Hudson team
Re: Regarding build number customization for hudson jobs [message #1183840 is a reply to message #1183308] Wed, 13 November 2013 04:10 Go to previous messageGo to next message
Martin Jose is currently offline Martin JoseFriend
Messages: 6
Registered: November 2013
Junior Member
Thank you so much Prakash for showing interest in my query.

We have some three environments where we perform our daily build and the build number needs to unique across all these three builds. That's the reason we generate our own build number for each build and commit that number in SVN so that it's available for the next build. Obviously we have three different Hudson jobs, and for each of these jobs we need the custom job number that we have in SVN.

But considering that we have "Parameterised Build on Other projects" option, I thought it should be straight forward, by preparing the build number using a Dummy Job and then passing the BUILD_NUMBER as a parameter in a property file for the actual build job which is configured as a dependent job for the first.

Kindly let me know if my understanding is wrong. Or should I use some other parameter for the job number?

Thanks,
Martin
Re: Regarding build number customization for hudson jobs [message #1196113 is a reply to message #1183840] Tue, 19 November 2013 08:51 Go to previous message
Martin Jose is currently offline Martin JoseFriend
Messages: 6
Registered: November 2013
Junior Member
Hi Winston,

Seems customizing the build number is not very obvious.

I am thinking of an alternate approach where I can populate the actual build number from SVN in to a custom variable for the hudson job and include this information in the email notifications about the build.

So I would like to know whether it is possible to dynamically a load property file , while a job is running. If this is possible then as part of the hudson build job I can get the SVN build number and populate that in some property file in the hudson server. And then include this property value in the build notification email

Very much appreciate any help.

Thanks,
Martin
Previous Topic:Keeping build number consistent across job flow
Next Topic:Subversion,ERROR: hudson.model.Job.hasCascadingProject()Z
Goto Forum:
  


Current Time: Wed Apr 24 23:47:53 GMT 2024

Powered by FUDForum. Page generated in 0.03016 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top