Differential D14288 Diff 37386 src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php
Show All 14 Lines | public function getBuildStepGroupKey() { | ||||
return HarbormasterExternalBuildStepGroup::GROUPKEY; | return HarbormasterExternalBuildStepGroup::GROUPKEY; | ||||
} | } | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Run a build in CircleCI.'); | return pht('Run a build in CircleCI.'); | ||||
} | } | ||||
public function getEditInstructions() { | public function getEditInstructions() { | ||||
$hook_uri = '/harbormaster/hook/circleci/'; | |||||
$hook_uri = PhabricatorEnv::getProductionURI($hook_uri); | |||||
return pht(<<<EOTEXT | return pht(<<<EOTEXT | ||||
WARNING: This build step is new and experimental! | WARNING: This build step is new and experimental! | ||||
To build **revisions** with CircleCI, they must: | To build **revisions** with CircleCI, they must: | ||||
- belong to a tracked repository; | - belong to a tracked repository; | ||||
- the repository must have a Staging Area configured; | - the repository must have a Staging Area configured; | ||||
- the Staging Area must be hosted on GitHub; and | - the Staging Area must be hosted on GitHub; and | ||||
- you must configure the webhook described below. | - you must configure the webhook described below. | ||||
To build **commits** with CircleCI, they must: | To build **commits** with CircleCI, they must: | ||||
- belong to a repository that is being imported from GitHub; and | - belong to a repository that is being imported from GitHub; and | ||||
- you must configure the webhook described below. | - you must configure the webhook described below. | ||||
Webhook Configuration | Webhook Configuration | ||||
===================== | ===================== | ||||
IMPORTANT: This has not been implemented yet. | Add this webhook to your `circle.yml` file to make CircleCI report results | ||||
to Harbormaster. Until you install this hook, builds will hang waiting for | |||||
a response from CircleCI. | |||||
```lang=yml | |||||
notify: | |||||
webhooks: | |||||
- url: %s | |||||
``` | |||||
Environment | Environment | ||||
=========== | =========== | ||||
These variables will be available in the build environment: | These variables will be available in the build environment: | ||||
| Variable | Description | | | Variable | Description | | ||||
|----------|-------------| | |----------|-------------| | ||||
| `HARBORMASTER_BUILD_TARGET_PHID` | PHID of the Build Target. | | `HARBORMASTER_BUILD_TARGET_PHID` | PHID of the Build Target. | ||||
EOTEXT | EOTEXT | ||||
); | , | ||||
$hook_uri); | |||||
} | } | ||||
public static function getGitHubPath($uri) { | public static function getGitHubPath($uri) { | ||||
$uri_object = new PhutilURI($uri); | $uri_object = new PhutilURI($uri); | ||||
$domain = $uri_object->getDomain(); | $domain = $uri_object->getDomain(); | ||||
if (!strlen($domain)) { | if (!strlen($domain)) { | ||||
$uri_object = new PhutilGitURI($uri); | $uri_object = new PhutilGitURI($uri); | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |