Package: jenkinsapi
About this libraryJenkins is the market leading continuous integration system, originally created by Kohsuke Kawaguchi.Jenkins (and It’s predecessor Hudson) are useful projects for automating common development tasks (e.g. unit-testing, production batches) - but they are somewhat Java-centric. Thankfully the designers have provided an excellent and complete REST interface. This library wraps up that interface as more conventional python objects in order to make many Jenkins oriented tasks easier to automate.This library allows you to automate most common Jenkins operations using Python, such as:Ability to add/remove/query Jenkins jobsAbility to execute jobs and:Query the results of a completed buildBlock until jobs are complete or run jobs asyncronouslyGet objects representing the latest builds of a jobWork with build artifacts:Search for artifacts by simple criteriaInstall artifacts to custom-specified directory structuresAbility to search for builds by source code revisionAbility to add/remove/query:Slaves (Webstart and SSH slaves)Views (including nested views using NestedViews Jenkins plugin)Credentials (username/password and ssh key)Username/password auth support for jenkins instances with auth turned onAbility to script jenkins installation including pluginsFor a full documentation spec of what this library supports see:http://jenkinsapi.readthedocs.io/en/latest/index.htmlPython versionsThe project has been tested against Python versions:2.73.43.53.63.7Jenkins versionsProject tested on both stable (LTS) and latest Jenkins versions.Known issuesJob deletion operations fail unless Cross-Site scripting protection is disabled.For other issues, please refer to the support URL below.Important LinksSupport and bug-reports:https://github.com/pycontribs/jenkinsapi/issues?direction=desc&sort=comments&state=openProject source code: github:https://github.com/pycontribs/jenkinsapiProject documentation:https://jenkinsapi.readthedocs.org/en/latest/Releases:http://pypi.python.org/pypi/jenkinsapiInstallationEgg-files for this project are hosted on PyPi. Most Python users should be able to use pip or setuptools to automatically install this project.Using Pip or SetuptoolsMost users can do the following:pipinstalljenkinsapiOr:easy_installjenkinsapiBoth of these techniques can be combined with virtualenv to create an application-specific installation.Using your operating-system’s package managerUbuntu users can now use apt to install this package:apt-getinstallpython-jenkinsapiBeware that this technique will get a somewhat older version of Jenkinsapi.ExampleJenkinsAPI is intended to map the objects in Jenkins (e.g. Builds, Views, Jobs) into easily managed Python objects:>>>importjenkinsapi>>>fromjenkinsapi.jenkinsimportJenkins>>>J=Jenkins('http://localhost:8080')>>>J.version1.542>>>J.keys()# Jenkins objects appear to be dict-like, mapping keys (job-names) to['foo','test_jenkinsapi']>>>J['test_jenkinsapi']<jenkinsapi.job.Jobtest_jenkinsapi>>>>J['test_jenkinsapi'].get_last_good_build()<jenkinsapi.build.Buildtest_jenkinsapi#77>...More examples available on Github:https://github.com/pycontribs/jenkinsapi/tree/master/examplesTestingIf you have installed the test dependencies on your system already, you can run
the testsuite with the following command:pythonsetup.pytestOtherwise using a virtualenv is recommended. Setuptools will automatically fetch
missing test dependencies:virtualenvsource.venv/bin/active(venv)pythonsetup.pytestDevelopmentMake sure that you haveJavainstalled.Create virtual environment for developmentInstall package in development mode(venv)pipinstall-e.(venv)pipinstall-rtest-requirements.txtMake your changes, write tests and check your code(venv)toxProject ContributorsAleksey Maksimov (ctpeko3a@gmail.com)Salim Fadhley (sal@stodge.org)Ramon van Alteren (ramon@vanalteren.nl)Ruslan Lutsenko (ruslan.lutcenko@gmail.com)Cleber J Santos (cleber@simplesconsultoria.com.br)William Zhang (jollychang@douban.com)Victor Garcia (bravejolie@gmail.com)Bradley Harris (bradley@ninelb.com)Kyle Rockman (kyle.rockman@mac.com)Sascha Peilicke (saschpe@gmx.de)David Johansen (david@makewhat.is)Misha Behersky (bmwant@gmail.com)Please do not contact these contributors directly for support questions! Use the GitHub tracker instead.LicenseThe MIT License (MIT): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.