Differential D14286 Diff 37385 src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | abstract class HarbormasterBuildStepImplementation extends Phobject { | ||||
| /** | /** | ||||
| * The description of the implementation, based on the current settings. | * The description of the implementation, based on the current settings. | ||||
| */ | */ | ||||
| public function getDescription() { | public function getDescription() { | ||||
| return $this->getGenericDescription(); | return $this->getGenericDescription(); | ||||
| } | } | ||||
| public function getEditInstructions() { | |||||
| return null; | |||||
| } | |||||
| /** | /** | ||||
| * Run the build target against the specified build. | * Run the build target against the specified build. | ||||
| */ | */ | ||||
| abstract public function execute( | abstract public function execute( | ||||
| HarbormasterBuild $build, | HarbormasterBuild $build, | ||||
| HarbormasterBuildTarget $build_target); | HarbormasterBuildTarget $build_target); | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | foreach ($futures->setUpdateInterval(5) as $key => $future) { | ||||
| if ($this->shouldAbort($build, $target)) { | if ($this->shouldAbort($build, $target)) { | ||||
| throw new HarbormasterBuildAbortedException(); | throw new HarbormasterBuildAbortedException(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| protected function logHTTPResponse( | |||||
| HarbormasterBuild $build, | |||||
| HarbormasterBuildTarget $build_target, | |||||
| BaseHTTPFuture $future, | |||||
| $label) { | |||||
| list($status, $body, $headers) = $future->resolve(); | |||||
| $header_lines = array(); | |||||
| // TODO: We don't currently preserve the entire "HTTP" response header, but | |||||
| // should. Once we do, reproduce it here faithfully. | |||||
| $status_code = $status->getStatusCode(); | |||||
| $header_lines[] = "HTTP {$status_code}"; | |||||
| foreach ($headers as $header) { | |||||
| list($head, $tail) = $header; | |||||
| $header_lines[] = "{$head}: {$tail}"; | |||||
| } | |||||
| $header_lines = implode("\n", $header_lines); | |||||
| $build_target | |||||
| ->newLog($label, 'http.head') | |||||
| ->append($header_lines); | |||||
| $build_target | |||||
| ->newLog($label, 'http.body') | |||||
| ->append($body); | |||||
| } | |||||
| /* -( Automatic Targets )-------------------------------------------------- */ | /* -( Automatic Targets )-------------------------------------------------- */ | ||||
| public function getBuildStepAutotargetStepKey() { | public function getBuildStepAutotargetStepKey() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| Show All 9 Lines | |||||