Build number from SVN revision number

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Build number from SVN revision number

Daniel Noll
Hi all.

I saw this post on the mailing list from quite some time ago:
http://www.nabble.com/SVN-revision-as-build-number---td12090873.html#a12090873

Is this still not possible to do?  I think that in conjunction with Subversion Release Manager [1], it would be a useful way to correlate which build was for which revision, which would be useful for doing binary searches to figure out which revision broke a build, while not reordering the numbers.

Even if the same revision can be built twice, if the previous build failed then it could be deleted first, and if the previous build succeeded then you could prohibit building it again (and there would be no point, right?  If someone did somehow find a reason to do it, they could always manually delete the build before retrying it.)

Failing this, is there some way we can set up builds to queue against specific revision numbers, as those revisions are detected, and not coalesce on the build queue?  At the moment, one of my team's bigger problems is that 20 revisions might go through between builds, and it's hard to figure out which one caused the problem.  We have a relatively decent build farm so it should be possible to run 4-5 builds at the same time, unless there is some limitation in Hudson which prevents this.

Daniel

[1]: http://wiki.hudson-ci.org/display/HUDSON/Subversion+Release+Manager
Reply | Threaded
Open this post in threaded view
|

Re: Build number from SVN revision number

dhartford

Outside of hudson, if you are using maven build system and only intend in having a 'version' visible to someone, you can use

maven-build-number-plugin

*creates a file that contains the SVN revision number as part of the 'version' in a file.  Could be included as a property file, in your Manifest.mf, but NOT part of the artifact filename (instead, it is inside the artifact).

-D

--- On Wed, 6/24/09, Daniel Noll <[hidden email]> wrote:

> From: Daniel Noll <[hidden email]>
> Subject: Build number from SVN revision number
> To: [hidden email]
> Date: Wednesday, June 24, 2009, 11:58 PM
>
> Hi all.
>
> I saw this post on the mailing list from quite some time
> ago:
> http://www.nabble.com/SVN-revision-as-build-number---td12090873.html#a12090873
>
> Is this still not possible to do?  I think that in
> conjunction with
> Subversion Release Manager [1], it would be a useful way to
> correlate which
> build was for which revision, which would be useful for
> doing binary
> searches to figure out which revision broke a build, while
> not reordering
> the numbers.
>
> Even if the same revision can be built twice, if the
> previous build failed
> then it could be deleted first, and if the previous build
> succeeded then you
> could prohibit building it again (and there would be no
> point, right?  If
> someone did somehow find a reason to do it, they could
> always manually
> delete the build before retrying it.)
>
> Failing this, is there some way we can set up builds to
> queue against
> specific revision numbers, as those revisions are detected,
> and not coalesce
> on the build queue?  At the moment, one of my team's
> bigger problems is that
> 20 revisions might go through between builds, and it's hard
> to figure out
> which one caused the problem.  We have a relatively
> decent build farm so it
> should be possible to run 4-5 builds at the same time,
> unless there is some
> limitation in Hudson which prevents this.
>
> Daniel
>
> [1]: http://wiki.hudson-ci.org/display/HUDSON/Subversion+Release+Manager
>
> --
> View this message in context: http://www.nabble.com/Build-number-from-SVN-revision-number-tp24196593p24196593.html
> Sent from the Hudson users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


   

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Build number from SVN revision number

Fabrizio Giudici
Darren Hartford wrote:
> Outside of hudson, if you are using maven build system and only intend in having a 'version' visible to someone, you can use
>
> maven-build-number-plugin
>
> *creates a file that contains the SVN revision number as part of the 'version' in a file.  Could be included as a property file, in your Manifest.mf, but NOT part of the artifact filename (instead, it is inside the artifact).
>  
Indeed it is possible to use it also in the artifact filename (I'm using
it since a few weeks). This seems to do the trick:

    <build>
        <!-- For buildNumber to be properly evaluated by
assembly:assembly, use also the validate goal -->
       
<finalName>${project.artifactId}-${project.version}.${buildNumber}</finalName>


The comment refers to a bug, in which if you want the buildNumber also
in assembled artifacts (assembly:assembly) you have to invoke the
validate goal too.



--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
[hidden email] - mobile: +39 348.150.6941


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Build number from SVN revision number

Qazwart-2
In reply to this post by Daniel Noll
If you're talking about replacing the build number itself with the
Subversion revision number: No, there are issues involved, and it
might not be possible to guarantee unique Subversion revision numbers.
Besides, there are other version control systems used by Hudson that
don't have the concept of repository revisions (or changesets), and
those wouldn't work.

However, you could include the Subversion revision number in an
artifact name or place it inside of a file that would contain this
revision number. The Subversion revision number is available as an
environment variable as SVN_REVISION. This can be passed into Ant and
Maven builds via -Dversion.num=$SVN_REVISION.

Also understand that the Subversion revision number is shown on all
builds. It is also inside the "build.xml" file inside the Hudson
builds directory for that build.  For example,
$HUDSON_HOME/jobs/MY_PROJECT/builds/73/build.xml will contain the
Subversion build number for Hudson build #73 for the MY_PROJECT build.

It shouldn't be too difficult to write a webpage in PHP or JavaScript
that would show the Hudson build vs. the Subversion Revision number.

On Wed, Jun 24, 2009 at 11:58 PM, Daniel Noll<[hidden email]> wrote:

>
> Hi all.
>
> I saw this post on the mailing list from quite some time ago:
> http://www.nabble.com/SVN-revision-as-build-number---td12090873.html#a12090873
>
> Is this still not possible to do?  I think that in conjunction with
> Subversion Release Manager [1], it would be a useful way to correlate which
> build was for which revision, which would be useful for doing binary
> searches to figure out which revision broke a build, while not reordering
> the numbers.
>
> Even if the same revision can be built twice, if the previous build failed
> then it could be deleted first, and if the previous build succeeded then you
> could prohibit building it again (and there would be no point, right?  If
> someone did somehow find a reason to do it, they could always manually
> delete the build before retrying it.)
>
> Failing this, is there some way we can set up builds to queue against
> specific revision numbers, as those revisions are detected, and not coalesce
> on the build queue?  At the moment, one of my team's bigger problems is that
> 20 revisions might go through between builds, and it's hard to figure out
> which one caused the problem.  We have a relatively decent build farm so it
> should be possible to run 4-5 builds at the same time, unless there is some
> limitation in Hudson which prevents this.
>
> Daniel
>
> [1]: http://wiki.hudson-ci.org/display/HUDSON/Subversion+Release+Manager
>
> --
> View this message in context: http://www.nabble.com/Build-number-from-SVN-revision-number-tp24196593p24196593.html
> Sent from the Hudson users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
David Weintraub
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]