During Jenkins deployment via e.g. puppet jenkins might be started but
not yet serving requests. Allow to wait for jenkins to enter normal
operation mode and fail if it doesn't show up after N seconds.
Allow for 0 seconds to just test and return success or failure without
any waiting.
This will allow us to avoid open coding "is jenkins ready?" for
different provisioners like puppet, chef, salt, ansible, ... when this
gets jused by jjb.
Change-Id: I7fd8aed43f571528f27dac681cc1e1f77a0e0ad7
Co-Authored-By: Darragh Bailey <dbailey@hp.com>
This patch adds the new `view_name` argument
to the `get_jobs` method that limits the list of jobs
returned to only those configured in the view specified.
Change-Id: I78266ed13cd6c183a2f4858458817455b79d9a23
Check if "kerberos" package can be imported at runtime
(in __init__.py). If not, everything works as before.
If "kerberos" package can be imported register a new
urllib handler (defined in urllib_kerb.py) which adds
support for kerberos auth.
This urllib handler (urllib_kerb.py) is only triggered
on 401 (Unauthorized) response, and we try to auth
with kerberos. If unsuccessful, next 401 handler (if any)
is triggered.
Change-Id: I1a47e455aa14535a124df950994718a11d7e4f57
Promotions can be attached to jobs via the REST API described at:
https://issues.jenkins-ci.org/browse/JENKINS-8963
Co-Authored-By: Guido Günther <agx@sigxcpu.org>
Co-Authored-By: Joao Vale <jpvale@gmail.com>
Change-Id: I756a35f53f96ba6e46e71f36ea99f62d32b604d2
Fixed create_node() raises HTTP Error 400 Bad Request
This issue caused by:
self.jenkins_open(Request(
self._build_url(CREATE_NODE, params), b''))
The "params" dictionary of options isn't parsed correctly
during _build_url funciton that Jenkins is expecting
Fixed it use urlencode to parse the params and construct
the URL
Change-Id: I85fa43bc0b4ff1530133b862734e94aede9b44a5
Closes-Bug: #1500898
Add some common management and version comparison capabilities via
dedicated classes to simplify how calling libraries can perform version
checks on the installed plugins.
Update the comments on the existing methods to note that they return the
raw plugin data in JSON format instead of the parsed local objects.
Change-Id: If43bb945f55c6fb9f8a6595091eace12e4630ffa
We can discover the next build number Jenkins will use for a particular
job using get_job_info(), but there's currently no way through
python-jenkins to set the next build number. This change introduces
the set_next_build_number() method which, given a job name and a
desired number, sets the next build number of the named job to the
given number.
Limitations: Jenkins enforces that build numbers must be monotonically
increasing, but gives no indication of an error; it simply ignores the
offending value.
Change-Id: I23b5a84b7ea37d66bf778a89343e3c81ffa9ceb6
This patch adds cloudbees folder plugin support. Folder should be
specified in job name : <folder>/<job>
This update also extend job_builder
(http://ci.openstack.org/jenkins-job-builder/) tool without any
modification.
Change-Id: I6d3957c217e1253e53152d90d5fcce5e69c77674
Co-Authored-By: Darragh Bailey <daragh.bailey@gmail.com>
Split existing tests into separate files and classes to make it easier
to select a subset to be executed when making modifications.
Add some simple consolidations of test data as example improvements that
can be extended by consolidating complete tests or sets of tests.
Change-Id: If2380e6f4e848ba68f05868e2ef4186d7912952b
Change where noindex is used to allow indexing of all the jenkins object
methods. This allows for cross reference links to methods to be created
in the documentation and sphinx will automatically generate the
necessary links.
Change-Id: Ic9c28debca382a003ae9560f0bf7943c35ef187d
This patch allows users to create, delete, reconfigure, and list views in
Jenkins. It is very similar to the protocols for working with jobs and has the
same code structure and format.
Change-Id: I79c557520cc9a417399a1a18df0f57da6904ab0e
Sphinx:
* Build dir is now named `build` and the files are under `source`.
* MakeFile learned texinfo, info and gettext targets
* include __init__ documentation (autoclass_content)
* keep file ordering for methods (autodoc_member_order)
* comment out html_static_path to get rid of a warning
Doc:
* Index is now... an index! Takes advantage of :glob: to automatically
create a complete table of content.
* Creates API reference which list the documentation directly from the
jenkins/__init__.py file. That will avoid the documentation duplication
and some out of sync documentation.
* insert the module in the path to document it
* the example were both in index.rst and __init__.py create a new section
with example.rst. That can be later be improved with some typical use
cases.
* A couple documentation update to some methods. The inline documentation
was out of sync though the index.rst got updated.