Merge pull request #223 from deep9/issue_221_gitlab
Proposed enhancement - fix for #221 GitlabBuild
This commit is contained in:
commit
12cca9c93c
|
@ -215,11 +215,19 @@ class ProjectBase extends Model
|
|||
/**
|
||||
* Get the value of AccessInformation / access_information.
|
||||
*
|
||||
* @param string|null $key Key of desired information
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccessInformation()
|
||||
public function getAccessInformation($key = null)
|
||||
{
|
||||
$rtn = $this->data['access_information'];
|
||||
if (is_null($key)) {
|
||||
$rtn = $this->data['access_information'];
|
||||
} else if (isset($this->data['access_information'][$key])) {
|
||||
$rtn = $this->data['access_information'][$key];
|
||||
} else {
|
||||
$rtn = null;
|
||||
}
|
||||
|
||||
return $rtn;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class GitlabBuild extends RemoteGitBuild
|
|||
*/
|
||||
public function getCommitLink()
|
||||
{
|
||||
$domain = $this->getProject()->getAccessInformation()["domain"];
|
||||
$domain = $this->getProject()->getAccessInformation("domain");
|
||||
return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class GitlabBuild extends RemoteGitBuild
|
|||
*/
|
||||
public function getBranchLink()
|
||||
{
|
||||
$domain = $this->getProject()->getAccessInformation()["domain"];
|
||||
$domain = $this->getProject()->getAccessInformation("domain");
|
||||
return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch();
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,8 @@ class GitlabBuild extends RemoteGitBuild
|
|||
$key = trim($this->getProject()->getGitKey());
|
||||
|
||||
if (!empty($key)) {
|
||||
$user = $this->getProject()->getAccessInformation()["user"];
|
||||
$domain = $this->getProject()->getAccessInformation()["domain"];
|
||||
$user = $this->getProject()->getAccessInformation("user");
|
||||
$domain = $this->getProject()->getAccessInformation("domain");
|
||||
return $user . '@' . $domain . ':' . $this->getProject()->getReference() . '.git';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue