for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MatthiasMullie\CI\Providers;
use MatthiasMullie\CI\Environment;
/**
* @see https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
* @see https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables
*
* @author Matthias Mullie <[email protected]>
* @copyright Copyright (c) 2016, Matthias Mullie. All rights reserved.
* @license LICENSE MIT
*/
class Jenkins extends None implements Environment
{
* {@inheritdoc}
public static function isCurrent()
return getenv('JENKINS_URL') !== false;
}
public function getProvider()
return 'jenkins';
public function getRepo()
return getenv('GIT_URL');
public function getBranch()
return getenv('ghprbSourceBranch') ?: getenv('GIT_BRANCH') ?: getenv('CVS_BRANCH');
public function getPullRequest()
return getenv('ghprbPullId') ?: '';
public function getCommit()
return getenv('ghprbActualCommit') ?: getenv('GIT_COMMIT');
public function getAuthor()
return getenv('ghprbActualCommitAuthor') ?: parent::getAuthor();
public function getAuthorEmail()
return getenv('ghprbActualCommitAuthorEmail') ?: parent::getAuthorEmail();
public function getBuild()
return getenv('BUILD_NUMBER');