Using Jenkins XML API

2,396 views

Published on

Published in: Technology, News & Politics
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
2,396
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
20
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Using Jenkins XML API

  1. 1. Jenkins User Conference Herzelia, July 5 2012 Using Jenkins XML API Anton Weiss AT&T Israel #jenkinsconf
  2. 2. Jenkins User Conference Herzelia, July 5 2012 Contents: !   Remote API overview. !   Why XML API? !   Example. #jenkinsconf
  3. 3. Jenkins User Conference Herzelia, July 5 2012 Jenkins Remote API !   XML, JSON or Python !   What can you do? •  Retrieve information. •  Trigger jobs. •  Copy/Create jobs #jenkinsconf
  4. 4. Jenkins User Conference Herzelia, July 5 2012 #jenkinsconf Why XML API !   Use scripts, PERL, etc. !   Create custom reports and summaries. ! XPath selection with ‘xpath’: –  http://jenkins-dev01:8080/job/iOS_UC%20Build/api/xml? xpath=/*/description ! XPath selection with ‘exclude’: –  http://jenkins-dev01:8080/job/iOS_UC%20Build/api/xml? exclude=/*/build !   Depth control: –  http://hudson-dev01:8080/view/Mobile/api/xml?depth=1
  5. 5. Jenkins User Conference Herzelia, July 5 2012 What data? ! ! ! ! !   Job causes.   Job statuses.   SCM changeset information.   View contents.   Etc. #jenkinsconf
  6. 6. Jenkins User Conference Herzelia, July 5 2012 Example: Build Flow Data !   Get to the first job: <cause> !   Get job status: <result>SUCCESS</result> !   Collect all the changes: <changeSet> #jenkinsconf
  7. 7. Jenkins User Conference Herzelia, July 5 2012 #jenkinsconf Tag <cause> <cause> … <upstreamUrl> job/3.1%20Build%20native%20AVEngineWrapper/ </upstreamUrl> </cause> Starting job: <cause> <shortDescription>Started by user aweiss </shortDescription> <userName> aweiss </userName> </cause>
  8. 8. Jenkins User Conference Herzelia, July 5 2012 #jenkinsconf <changeSet> Tag <changeSet> <item> <file> <comment>onEnterToForeground - add check to see if the call was not previously terminated before calling MediaEngine</comment> <date>1340204340000</date> <editType>edit</editType> <event>create version</event> <name>Android_EnablersAndroid_EnginessrccomattandroidenginescallCall.java</name> <operation>checkin</operation> <shortVersion>mainAndroid_Enablers_intAndroid_Enablers_Video_int63</shortVersion> <version>mainAndroid_Enablers_intAndroid_Enablers_Video_int63</version> </file> <hasFiles>true</hasFiles> <hasSubActivities>false</hasSubActivities> <headline>Enc00056522</headline> <integrationActivity>false</integrationActivity> <name>Enc00056522</name> <stream>Android_Enablers_Video_int</stream> <user>rsagiv</user> </item> ... </changeSet>
  9. 9. Jenkins User Conference Herzelia, July 5 2012 Questions? ? #jenkinsconf
  10. 10. Jenkins User Conference Herzelia, July 5 2012 Thank You To Our Sponsors Platinum Sponsors Silver Sponsor #jenkinsconf

×