Quantcast

how to include Jenkins Build Number in Ant script - quick question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to include Jenkins Build Number in Ant script - quick question

mpc8250
Hi

We like to sync up Jenkins build number with our version.xml file.
Is there a way to include Jenkins build number in our main ant script
build.xml so that it would write to our version.xml ?

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to include Jenkins Build Number in Ant script - quick question

Benjamin Lau
Take a look at XmlTask for Ant. You can then update your xml file using xpath.

Ben

[1] http://www.oopsconsultancy.com/software/xmltask/

On Thu, Nov 29, 2012 at 7:20 PM, Z W <[hidden email]> wrote:
> Hi
>
> We like to sync up Jenkins build number with our version.xml file.
> Is there a way to include Jenkins build number in our main ant script
> build.xml so that it would write to our version.xml ?
>
> Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Antwort: Re: how to include Jenkins Build Number in Ant script - quick question

Andreas Schilling
Hi,

your case sounds like you simply need to pick up the environment variable in your ant script:

<property environment="env" />

Then you can use the following variables:
https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables

e.g. ${env.BUILD_NUMBER}

Kind regards,

Andreas Schilling
CAE Processes & Data Management
-------------------------------------------------------------------
Dipl. Inf. Andreas Schilling
Senior Software Architect

TWT GmbH
Science & Innovation
Bernhäuser Str. 40 - 42
73765 Neuhausen

Tel: +49 - 7158 - 17 15 - 673
E-Mail: [hidden email]
--------------------------------------------------------------------
www.twt-gmbh.de
--------------------------------------------------------------------
Geschäftsführung: Dimitrios Vartziotis, Joachim Laicher (stv.)
Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778
Umsatzsteuer: ID-Nr.: DE147841145
--------------------------------------------------------------------




Von:        Benjamin Lau <[hidden email]>
An:        [hidden email]
Datum:        30.11.2012 04:23
Betreff:        Re: how to include Jenkins Build Number in Ant script - quick question
Gesendet von:        [hidden email]




Take a look at XmlTask for Ant. You can then update your xml file using xpath.

Ben

[1]
http://www.oopsconsultancy.com/software/xmltask/

On Thu, Nov 29, 2012 at 7:20 PM, Z W <[hidden email]> wrote:
> Hi
>
> We like to sync up Jenkins build number with our version.xml file.
> Is there a way to include Jenkins build number in our main ant script
> build.xml so that it would write to our version.xml ?
>
> Thanks

Loading...