jenkins
2013-03-12
No Description
Upstream URL
Author
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Maintainer
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
License
LLGPLv3; see COPYING file for details.
jenkins.api README
1Introduction
Thejenkins.api
system provides Common Lisp bindings for the RESTAPI of the Jenkins CI Server. It goals is to allow the enumeration,inspectation and mutation of the most important aspect of a Jenkinsinstance:- Nodes
- Jobs
- Builds
2Tutorial
This tutorial briefly demonstates how to establish a connection to aJenkins server and how access the Jenkins objects mentioned above.2.1URL and Credentials
The following special variables are used to controlauthentication to the server:jenkins.api:*base-url*
jenkins.api:*username*
jenkins.api:*password*
API tokens are not yet supported but will probably be implemented.
2.2Nodes
2.2.1Finding Nodes
CL-USER> (jenkins.api:all-nodes)
(#<JENKINS.API:NODE 192.168.100.120 {1014B3CFD3}>
#<JENKINS.API:NODE 192.168.100.121 {1014B3D2D3}>
#<JENKINS.API:NODE archlinux_64bit {1014B3D5D3}>
#<JENKINS.API:NODE MAC_OS_lion_64bit {1014B3D8D3}>
#<JENKINS.API:NODE ubuntu_lucid_32bit {1014B3DBD3}>
#<JENKINS.API:NODE ubuntu_lucid_64bit {1014B3DED3}>
#<JENKINS.API:NODE ubuntu_oneiric_32bit {1014B3E1D3}>
#<JENKINS.API:NODE ubuntu_oneiric_64bit {1014B3E4D3}>
#<JENKINS.API:NODE ubuntu_precise_32bit {1014B3E7D3}>
#<JENKINS.API:NODE ubuntu_precise_64bit {1014B3EAD3}>)
CL-USER> (mapcar #'jenkins.api:online? (jenkins.api:all-nodes))
(T T T T T T T T T T)
2.2.2TODOModifying Nodes
2.3Jobs
2.3.1TODOFinding Jobs
2.3.2Modifying Jobs
Jobs are ordinary instances of the classjenkins.api.job
and canthus be manipulated using slot readers and writers. Such changesonly affect the respective object, making it go out of sync withthe server. To persist changes, it is necessary to calljenkins.api:commit!
.Typically jenkins.api:commit!
will be called after performing a
batch of changes:
CL-USER> (let ((job (jenkins.api:job "foo")))
(setf (jenkins.api:keep/days job) 30
(jenkins.api:keep/count job) 10)
(jenkins.api:commit! job))
#<JENKINS.API:JOB foo {1015899ED3}>