On Thu, Jun 7, 2012 at 11:56 PM, Alex Earl <[email protected]> wrote:
>
> > I'm using it in the following way. During the build, the makefile
> picks up the revision number from the environment variable and creates
> a cpp macro definition with it, something like this:
> gcc -DBUILD_REVISION=3D$(SVN_REVISION) ...
> In the C code, I'm printing a version string in the binary:
> printf("TheGreatesCodeEver %d.%d SVN@
> %d",MAJOR_VERSION_NUMBER,MINOR_VERSION_NUMBER,BUILD_REVISION)
> and the output will be something like:
> "TheGreatesCodeEver 1.2 SVN@356"
>
> Now the problem is that if someone wants to look for the build in
> Jenkins, it won't be necessary able to identify the build because
> build page might show a number less than 356.
>
> p.s.: you might say that I should use the environment variable
> "BUILD_NUMBER" which will identify clearly the build in Jenkins,
> however the inconsistency between SVN numbers will still exist
Better yet, include both the build number and the revision number so
you can find it in both jenkins and subversion and know exactly what
you have. In theory, builds should be reproducible from the source
rev, but it practice they sometimes aren't.
--
Les Mikesell
[email protected]