Quantcast

Possibility to get build_status using jenkins environment variable

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

Possibility to get build_status using jenkins environment variable

varghese

Hi
  i want to get build status for using in an ant task. But i am not able to find an environment variable which contains the value of build status..
Please help to get the value of build status?

Any comment would be greatly appreciated.



Regards,
varghese
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Possibility to get build_status using jenkins environment variable

Sami Tikka
Where is the ant task running? In the same build or in a different build?

If the ant task is running in the same build, you can assume the build is successful, as it should have aborted if an earlier build step failed.

If the tas is running in a different build, you need to fetch the build status using XML API by GET $JENKINS_URL/job/JOB/BUILD/api/xml

-- Sami

Varghese Renny <[hidden email]> kirjoitti 24.7.2012 kello 13.56:

>
> Hi
>   i want to get build status for using in an ant task. But i am not able to find an environment variable which contains the value of build status..
> Please help to get the value of build status?
>
> Any comment would be greatly appreciated.
>
>
>
> Regards,
> varghese
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Possibility to get build_status using jenkins environment variable

varghese
Can you explain about xml api, whether i needed to install some plugin?
my purpose is i am writing an task. Using env i can access build_number, build_url but not build_status.
So Where i needed to $JENKINS_URL/job/JOB/BUILD/api/xml using GET?



Thanks in Advance,
varghese
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Possibility to get build_status using jenkins environment variable

Sami Tikka
Go to any Jenkins page. Click to place cursor in browser address bar. Add "/api" to the URL and hit enter.

-- Sami

Varghese Renny <[hidden email]> kirjoitti 25.7.2012 kello 15.02:

> Can you explain about xml api, whether i needed to install some plugin?
> my purpose is i am writing an task. Using env i can access build_number, build_url but not build_status.
> So Where i needed to $JENKINS_URL/job/JOB/BUILD/api/xml using GET?
>
>
>
> Thanks in Advance,
> varghese
Loading...