On 02/29/2012 07:55 AM, Andreas Tscharner wrote:

> On 29.02.2012 02:00, KB1JWQ wrote:>> [snip]

>> How do I sanely change the version number of each build so that it>> bumps 
>> the Debian changelog (else the deb build fails), the version>> number of the 
>> package, and probably the naming of the resulting .deb>> as well?  
>> Ultimately I want these debs to be put into a staging

>> Jenkins has its own "version number"; I'd suggest to use it. It is in> the 
>> environment variable BUILD_NUMBER. You could use this number as> your 
>> "Debian Revision" (the last number in the Debian version number;> the one 
>> after the dash '-').>> There is also a Version Number Plugin, if you want to 
>> control your> version number should have more information.> See: 
>> https://wiki.jenkins-ci.org/display/JENKINS/Version+Number+Plugin>> Best 
>> regards>     Andreas


Hi KB1JWQ,


For similar purposes i use a similar small shellscript to add a suffix
to the version number of the last item of the debian changelog:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#dch-version-suffixer.sh
#!/bin/sh

VERSION_SUFFIX=$1

sed -e "s/)/-${VERSION_SUFFIX})/" debian/changelog > temp.file
mv temp.file debian/changelog
echo "the new dch version is:" `head -1 debian/changelog`

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""





And from a shell execution build step i call it like this:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
cd $SOURCE_TREE_OF_PACKAGE_TO_BUILD
dch-version-suffixer.sh ${BUILD_NUMBER}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Of course you can replace the ${BUILD_NUMBER} with ${BUILD_ID}, or anything
provided the Version Number Plugin mentioned eariler.

Or if you need explicitly increment the version number (which i think
better if done by the package maintainer manually)
you can call the dch -i (see `man dch` for details) from your shell
execution buildstep.


Best regards:
zgyarmati


-- 
Zoltan Gyarmati
Gtalk: profi...@gmail.com
MSN: profi...@theend.hu
ICQ: 335693662
Skype: profikam3151

Phone number: 0036-30-608-30-79

Reply via email to