Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Index.php?title=Hudson/HowTo"

(Removing all content from page)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This section contains general information on How To do stuff with Hudson.   While the Main Hudson wiki page is a good starting point, it can leave a lot to be desired at times.   This section will cover specific eclipse project use cases.
 
  
 
 
= HOW DO I....  =
 
 
== Retrieve files from the Last Successful build and use them in the next?  ==
 
 
Each build has it's Last Successful Successful build available as a RESTful url. The format for this is:
 
 
https://build.eclipse.org/hudson/job/'''''JOBNAME'''''/lastSuccessfulBuild/artifact/
 
 
Replace JOBNAME with the name of the job that you are interested.   Any of the artifacts may be accessed and retrieved by giving the full path to it's location.  To retrieve a specific ZIP file from a Athena produced build one could use something like:
 
 
https://build.eclipse.org/hudson/view/WTP/job/cbi-wtp-wst.xsl/lastSuccessfulBuild/artifact/build/athena/wst-xsl-SDK-N200912121209.zip
 
 
This would GET the file wst-xsl-SDK-N2000912121209.zip from the build. See Athena's option for creating SNAPSHOTS to create standardized names to make automated retrieval easier.
 
 
The following build urls can always be accessed via RESTful API:
 
 
*Last Successful<br>
 
*Last Stable
 
*Last Build
 
*Last Failed Build
 
 
== Is there an API? ==
 
 
Yes.&nbsp;&nbsp;Hudson provides RESTFul style API for working with the system. You can use this API during your build to automated various portions. For example, retrieve a list of all the artifacts from the Last Successful Build. You may also access any of the artifacts via the URL for that artifact. This allows all a platform independent way to retrieve files from one build and reuse them in another build.
 
 
*[http://wiki.hudson-ci.org/display/HUDSON/Remote+access+API RESTFul API] - retrieve and access files via RESTful web services in XML, JSON or Python data formats.
 
 
<br>
 
 
== What URL's provide a RESTful interface? ==
 
 
Any of the following will provide a RESTful interface by adding /api on the end of the url.&nbsp; By appending it with xml, json, or python you can retrieve the information in those data formats.&nbsp;&nbsp; XML restufl also leverages the power of XPath to allow filtering of the data retrieved.&nbsp;&nbsp; See HUDSON's remote API documentation for more information.&nbsp;&nbsp; All Hudson RESTFul API's are backed by an XML Schema so data binding can be done.
 
 
Almost any of the URL's available on HUDSON can be accessed restfully.  You can experiment with adding the /api method to the end of the URL name. 
 
 
== How do I get a List of Artifacts from the Last Successful Build ==
 
You can get a list of artifacts in XML format by accessing your JOB's last succesful build permanent URL an adding /api/xml to the end.  For example.
 
 
[https://build.eclipse.org/hudson/job/cbi-wtp-wst.xsl/lastSuccessfulBuild/api/xml] will retrieve an XML formatted file that contains information about the last successful build.  You can then use this file as input to a program or a build script to retrieve the artifacts from the build.
 

Latest revision as of 00:36, 13 December 2009

Back to the top