2017 © Pedro Peláez
 

library jenkins-api

A PHP wrapper around the Jenkins API

image

coyledesign/jenkins-api

A PHP wrapper around the Jenkins API

  • Thursday, May 22, 2014
  • by kevincoyle
  • Repository
  • 1 Watchers
  • 1 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 76 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

Jenkins PHP API

Original code by Jenkins-Khan, (*1)

Installation

With composer add the following to your composer.json:, (*2)

"coyledesign/jenkins-api": "dev-master", (*3)

If your Jenkins need authentication, you need to pass and URL like this : 'http://user:token@host.org:8080'., (*4)

Here is some examples of how to use it :, (*5)

Get the color of the job

    $job = $jenkins->getJob("dev2-pull");
    var_dump($job->getColor());
    //string(4) "blue"

Launch a Job

    $job = $jenkins->launchJob("clone-deploy");

List the jobs of a given view

    $view = $jenkins->getView('madb_deploy');
    foreach ($view->getJobs() as $job) {
      var_dump($job->getName());
    }
    //string(13) "altlinux-pull"
    //string(8) "dev-pull"
    //string(9) "dev2-pull"
    //string(11) "fedora-pull"

List builds and their status

    $job = $jenkins->getJob('dev2-pull');
    foreach ($job->getBuilds() as $build) {
      var_dump($build->getNumber());
      var_dump($build->getResult());
    }
    //int(122)
    //string(7) "SUCCESS"
    //int(121)
    //string(7) "FAILURE"

Check if Jenkins is available

    var_dump($jenkins->isAvailable());
    //bool(true);

More information about Jenkins API could be found here, (*6)

The Versions

22/05 2014

dev-develop

dev-develop

A PHP wrapper around the Jenkins API

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

by Adrien Gallou
by Kevin Coyle

22/05 2014

dev-master

9999999-dev

A PHP wrapper around the Jenkins API

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

by Adrien Gallou
by Kevin Coyle

22/05 2014

0.1-alpha

0.1.0.0-alpha

A PHP wrapper around the Jenkins API

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

by Adrien Gallou
by Kevin Coyle