Commit Graph

35 Commits

Author SHA1 Message Date
Sorin Sbarnea e5e7a097b1
Adopt use of pre-commit hooks
- rename pep8 target to more generic linters
- migrates flake8 execution to pre-commit
- adds yaml linting
- hardening flake8 rules
- setting max-line-lengh to 120 instead of ignoring it.
- bumped minimal sphinx version
- configured sphinx with warnings as errors

Change-Id: I4c598c07297ae6a2160ba6754cec860adbfeb6f2
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-22 13:37:30 +01:00
Eduardo Gonzalez 17b8942733 Use proper code highlight in docs
Specify if is python, xml or bash the code blocks
in examples.
Fixes a couple doc build warnings

Change-Id: I3ea9f3aabe23656752c23c843c297f3872454a17
2018-04-17 10:27:59 +02:00
lvxianguo 151598d20a trivial: modify spelling error of version
Change-Id: Ibdbdc5437b2042bd6ec76ec789f66bd593a52d40
2018-01-18 10:25:52 +08:00
Ken Dreyer 828eb92c48 doc: add get_job_config() example
Change-Id: I0d1ad26fc9b3c3343f25e3f34786a4891ac60c78
2017-05-03 10:55:40 -06:00
Sam Clotfelter 0843ae7850 Changes get_job_info to get_build_info
Changes incorrect get_job_info call to correct get_build_info in docs.

Closes-bug: #1660089
Change-Id: I0a0ada795c4b0385a7ba6b23d0654b9faf077869
2017-01-28 19:13:04 -05:00
Guido Günther 0f6739103b Allow to wait for jenkins to enter normal operation
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>
2017-01-21 06:41:45 -08:00
Anh Tran d7d0470cc4 Remove redundant 'the'
Change-Id: I48b0f125a70cda096e17bc4f65da463c176add0f
2016-10-21 14:32:20 +07:00
Abhijeet Kasurde fc0600c035 Fixed a minor typo in example of Python-jenkins
Change-Id: Id99b7bc1f68f98da23c7b62227cbf673915cd991
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2016-07-04 18:10:30 +05:30
Ken Dreyer fd8c8151b9 add get_whoami()
This function is useful for simply testing that a user's authentication
credentials are correct.

Change-Id: I07841eccd9cd2015ac432c9c22fb8e451a638c0c
2016-04-21 07:45:19 -06:00
Aliaksandr Buhayeu f6f26ec481 Adds possibility to retrieve all jobs from the view specified
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
2016-02-22 18:03:48 +03:00
Jenkins 6728d36463 Merge "Add optional kerberos support" 2016-01-27 23:38:09 +00:00
Lukas Vacek 4152a0138b Add optional kerberos support
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
2016-01-27 23:08:04 +01:00
Guido Günther 0c503b724c Add support for handling promotions
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
2016-01-13 18:14:39 +01:00
Dong Ma 302eb5dad6 Fixed create_node() Error
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
2015-12-12 18:35:03 +08:00
Jenkins 344b5f3ffa Merge "Provider helper classes for plugin data management" 2015-09-28 17:34:05 +00:00
Darragh Bailey 8b3023dc18 Provider helper classes for plugin data management
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
2015-09-28 18:15:57 +01:00
Kevin L. Mitchell 244b4fed30 Allow setting the next build number
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
2015-09-24 10:06:05 -05:00
Jerome Hourquebie 7267eec454 Adds Cloudbees folder plugin support
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>
2015-09-21 18:25:35 +01:00
Khai Do d1713ad228 fix get version example
Change-Id: I8fbcd518c078fbe15a99cc709072b86f93dad669
2015-09-10 12:08:43 -07:00
Darragh Bailey c58ae7e1af Separate tests in separate files and classes
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
2015-08-25 01:11:47 +01:00
Darragh Bailey acd614fae7 Create module member index from autodoc
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
2015-08-25 00:49:06 +01:00
Khai Do f0989dd2ba Rework the examples
Create additional examples to help users get started.

Change-Id: I609dd06ee33033ae5efc18fa39ce920721998412
2015-08-06 06:27:26 -07:00
Brandon Leonard cabb95d873 Creates ability to work with views in jenkins
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
2015-07-06 12:14:26 +02:00
Khai Do a33954067b Fix examples
The jenkins json response for get_job_info contains 'nextBuildNumber'
key not 'next_build_number'

Change-Id: I52303b967c966fb4604507319072366f78959b41
2015-03-18 15:39:25 -07:00
Khai Do 3ce7471b0a Update and clean up docs
* Reference the readme.rst in index.rst to remove redundancy
* General cleanup and updates

Change-Id: I33c9c12b94282ce3a0b3366715a3797e6c3b019c
2015-01-27 20:03:13 +00:00
Khai Do 21d604c4e6 Setup pbr versioning for docs
Change-Id: I77572a5f6185c19728028547c23bc76d73e48f22
2014-09-26 09:12:54 -07:00
Marc Abramowitz 41cee2c5b2 Fix `tox -e doc` duplicate id error
by adding `:noindex:` to doc/source/api.rst

Change-Id: Ie767a05f8375a2bea6b564d45adcf8b78bae1845
2014-07-03 09:38:55 -07:00
Marc Abramowitz 8166a976a0 Doc fixes
Change-Id: I689f10b1da0d147b9b3b9b1ba1ba5592fea42f23
2014-05-02 10:04:42 -07:00
David Strauss 59a2c58e75 Fedora 19+ has packages, too. 2014-03-06 14:23:43 -08:00
Antoine Musso 170e878d2a overhaul the sphinx documentation
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.
2013-04-13 23:59:59 +02:00
Antoine Musso c3e23c2973 pass pep8 on all files
pep8 is the python style standard. I have ignored long lines though.
2013-04-13 20:35:11 +02:00
Ken Rumer 7aee918523 Updated documentation, updated error handler for consistency 2012-03-01 11:03:09 -07:00
Ken Rumer 2af93d33bf Added build_info 2012-02-29 10:23:45 -07:00
Ken Conley kwc@willowgarage.com 80ee179651 Documentation updates. Sphinx no longer uses automodule. Filled in some missing API methods. Corrected references
to Hudson in doc strings.
2011-09-03 17:24:56 -07:00
Ken Conley kwc@willowgarage.com 0e3f41e53a Converting documentation to sphinx 2011-09-03 17:00:30 -07:00