Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryCommit.php
<?php | <?php | ||||
final class PhabricatorRepositoryCommit | final class PhabricatorRepositoryCommit | ||||
extends PhabricatorRepositoryDAO | extends PhabricatorRepositoryDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorFlaggableInterface, | PhabricatorFlaggableInterface, | ||||
PhabricatorProjectInterface, | PhabricatorProjectInterface, | ||||
PhabricatorTokenReceiverInterface, | PhabricatorTokenReceiverInterface, | ||||
PhabricatorSubscribableInterface, | PhabricatorSubscribableInterface, | ||||
PhabricatorMentionableInterface, | PhabricatorMentionableInterface, | ||||
HarbormasterBuildableInterface, | HarbormasterExternalBuildableInterface, | ||||
HarbormasterCircleCIBuildableInterface, | |||||
HarbormasterBuildkiteBuildableInterface, | HarbormasterBuildkiteBuildableInterface, | ||||
PhabricatorCustomFieldInterface, | PhabricatorCustomFieldInterface, | ||||
PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorTimelineInterface, | PhabricatorTimelineInterface, | ||||
PhabricatorFulltextInterface, | PhabricatorFulltextInterface, | ||||
PhabricatorFerretInterface, | PhabricatorFerretInterface, | ||||
PhabricatorConduitResultInterface, | PhabricatorConduitResultInterface, | ||||
PhabricatorDraftInterface { | PhabricatorDraftInterface { | ||||
▲ Show 20 Lines • Show All 662 Lines • ▼ Show 20 Lines | public function getAvailableBuildVariables() { | ||||
); | ); | ||||
} | } | ||||
public function newBuildableEngine() { | public function newBuildableEngine() { | ||||
return new DiffusionBuildableEngine(); | return new DiffusionBuildableEngine(); | ||||
} | } | ||||
/* -( HarbormasterCircleCIBuildableInterface )----------------------------- */ | public function getExternalBuildableRef() { | ||||
return array( | |||||
HarbormasterExternalBuildableInterface::COMMIT, | |||||
public function getCircleCIGitHubRepositoryURI() { | $this->getCommitIdentifier(), | ||||
$repository = $this->getRepository(); | ); | ||||
$commit_phid = $this->getPHID(); | |||||
$repository_phid = $repository->getPHID(); | |||||
if ($repository->isHosted()) { | |||||
throw new Exception( | |||||
pht( | |||||
'This commit ("%s") is associated with a hosted repository '. | |||||
'("%s"). Repositories must be imported from GitHub to be built '. | |||||
'with CircleCI.', | |||||
$commit_phid, | |||||
$repository_phid)); | |||||
} | |||||
$remote_uri = $repository->getRemoteURI(); | |||||
$path = HarbormasterCircleCIBuildStepImplementation::getGitHubPath( | |||||
$remote_uri); | |||||
if (!$path) { | |||||
throw new Exception( | |||||
pht( | |||||
'This commit ("%s") is associated with a repository ("%s") that '. | |||||
'with a remote URI ("%s") that does not appear to be hosted on '. | |||||
'GitHub. Repositories must be hosted on GitHub to be built with '. | |||||
'CircleCI.', | |||||
$commit_phid, | |||||
$repository_phid, | |||||
$remote_uri)); | |||||
} | |||||
return $remote_uri; | |||||
} | |||||
public function getCircleCIBuildIdentifierType() { | |||||
return 'revision'; | |||||
} | |||||
public function getCircleCIBuildIdentifier() { | |||||
return $this->getCommitIdentifier(); | |||||
} | } | ||||
/* -( HarbormasterBuildkiteBuildableInterface )---------------------------- */ | /* -( HarbormasterBuildkiteBuildableInterface )---------------------------- */ | ||||
public function getBuildkiteBranch() { | public function getBuildkiteBranch() { | ||||
$viewer = PhabricatorUser::getOmnipotentUser(); | $viewer = PhabricatorUser::getOmnipotentUser(); | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0