Refactoring builds out into separate model types (Github, Bitbucket, Local) and builder to use build->createWorkingCopy() to make build directory. Fixes #29
This commit is contained in:
parent
1a92d1c619
commit
be37a5e821
9 changed files with 304 additions and 150 deletions
38
PHPCI/Model/Build/BitbucketBuild.php
Normal file
38
PHPCI/Model/Build/BitbucketBuild.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Build model for table: build
|
||||
*/
|
||||
|
||||
namespace PHPCI\Model\Build;
|
||||
use PHPCI\Model\Build;
|
||||
use PHPCI\Model\Build\RemoteGitBuild;
|
||||
|
||||
/**
|
||||
* Build Model
|
||||
* @uses PHPCI\Model\Build
|
||||
*/
|
||||
class BitbucketBuild extends RemoteGitBuild
|
||||
{
|
||||
public function getCommitLink()
|
||||
{
|
||||
return 'https://bitbucket.org/' . $this->getProject()->getReference() . '/commits/' . $this->getCommitId();
|
||||
}
|
||||
|
||||
public function getBranchLink()
|
||||
{
|
||||
return 'https://bitbucket.org/' . $this->getProject()->getReference() . '/src/?at=' . $this->getBranch();
|
||||
}
|
||||
|
||||
protected function getCloneUrl()
|
||||
{
|
||||
$key = trim($this->getProject()->getGitKey());
|
||||
|
||||
if(!empty($key)) {
|
||||
return 'git@bitbucket.org:' . $this->getProject()->getReference() . '.git';
|
||||
}
|
||||
else {
|
||||
return 'https://bitbucket.org/' . $this->getProject()->getReference() . '.git';
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue