codedmonkey/jenkins

Provides an object-oriented interface to connect with a Jenkins installation

dev-master 2019-06-02 18:10 UTC

This package is auto-updated.

Last update: 2024-03-29 04:04:46 UTC


README

The Jenkins component provides an object-oriented interface to connect with a Jenkins installation through the REST API.

Please note that this library is still in development, usage in production environments is highly discouraged. Feel free to open an issue for any feature requests or unexpected behavior.

Installation

This component requires an HTTP Client that integrates with HTTPlug. The CURL Client works fine in most cases, but you can also choose to integrate with a third-party library like Guzzle. For integration with the Symfony framework, see HttplugBundle.

This component is available as a package on Packagist:

composer require codedmonkey/jenkins php-http/curl-client guzzlehttp/psr7

Basic Usage

To set up a connection to the Jenkins installation, provide a URL containing a username and an API token through HTTP basic authentication. This is usually formatted as http://username:token@hostname:port.

use CodedMonkey\Jenkins\Jenkins;

$jenkins = new Jenkins('http://tim:1234567890@jenkins.host');

// Get an array of all jobs
$jenkins->jobs->all();

Running Tests

composer install
vendor/bin/phpunit

Documentation

Resources

License

This component is released under the MIT license.