Updating PHPCI to send more detailed commit statuses, for @REBELinBLUE.
This commit is contained in:
parent
dc6e63a7e7
commit
aaf93ddd7d
|
@ -59,25 +59,35 @@ class GithubBuild extends RemoteGitBuild
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
$status = 'pending';
|
$status = 'pending';
|
||||||
|
$description = 'PHPCI build running.';
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$status = 'success';
|
$status = 'success';
|
||||||
|
$description = 'PHPCI build passed.';
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$status = 'failure';
|
$status = 'failure';
|
||||||
|
$description = 'PHPCI build failed.';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$status = 'error';
|
$status = 'error';
|
||||||
|
$description = 'PHPCI build failed to complete.';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpciUrl = \b8\Config::getInstance()->get('phpci.url');
|
$phpciUrl = \b8\Config::getInstance()->get('phpci.url');
|
||||||
$params = array( 'state' => $status,
|
|
||||||
'target_url' => $phpciUrl . '/build/view/' . $this->getId());
|
$params = array(
|
||||||
|
'state' => $status,
|
||||||
|
'target_url' => $phpciUrl . '/build/view/' . $this->getId(),
|
||||||
|
'description' => $description,
|
||||||
|
'context' => 'PHPCI',
|
||||||
|
);
|
||||||
|
|
||||||
$headers = array(
|
$headers = array(
|
||||||
'Authorization: token ' . $token,
|
'Authorization: token ' . $token,
|
||||||
'Content-Type: application/x-www-form-urlencoded'
|
'Content-Type: application/x-www-form-urlencoded'
|
||||||
);
|
);
|
||||||
|
|
||||||
$http->setHeaders($headers);
|
$http->setHeaders($headers);
|
||||||
$http->request('POST', $url, json_encode($params));
|
$http->request('POST', $url, json_encode($params));
|
||||||
|
|
Loading…
Reference in a new issue