Page MenuHomePhabricator

D7540.diff
No OneTemporary

D7540.diff

Index: src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
===================================================================
--- src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
+++ src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
@@ -31,14 +31,14 @@
$variables = $this->retrieveVariablesFromBuild($build);
$command = $settings['command'];
preg_match_all(
- "/\\\$\\{(?P<name>[a-z]+)\\}/",
+ "/\\\$\\{(?P<name>[a-z\.]+)\\}/",
$command,
$matches);
foreach ($matches["name"] as $match) {
$parameters[] = idx($variables, $match, "");
}
$command = str_replace("%", "%%", $command);
- $command = preg_replace("/\\\$\\{(?P<name>[a-z]+)\\}/", "%s", $command);
+ $command = preg_replace("/\\\$\\{(?P<name>[a-z\.]+)\\}/", "%s", $command);
$command = vcsprintf(
$command,
@@ -90,6 +90,12 @@
// Get the return value so we can log that as well.
list($err) = $future->resolve();
+ // Retrieve the last few bits of information.
+ list($stdout, $stderr) = $future->read();
+ $log_stdout->append($stdout);
+ $log_stderr->append($stderr);
+ $future->discardBuffers();
+
$log_stdout->finalize($start_stdout);
$log_stderr->finalize($start_stderr);
Index: src/applications/harbormaster/step/VariableBuildStepImplementation.php
===================================================================
--- src/applications/harbormaster/step/VariableBuildStepImplementation.php
+++ src/applications/harbormaster/step/VariableBuildStepImplementation.php
@@ -4,29 +4,31 @@
public function retrieveVariablesFromBuild(HarbormasterBuild $build) {
$results = array(
- 'revision' => null,
- 'commit' => null,
- 'repository' => null,
- 'vcs' => null,
- 'uri' => null,
- 'timestamp' => null);
+ 'buildable.revision' => null,
+ 'buildable.commit' => null,
+ 'repository.callsign' => null,
+ 'repository.vcs' => null,
+ 'repository.uri' => null,
+ 'step.timestamp' => null,
+ 'build.id' => null);
$buildable = $build->getBuildable();
$object = $buildable->getBuildableObject();
$repo = null;
if ($object instanceof DifferentialRevision) {
- $results['revision'] = $object->getID();
+ $results['buildable.revision'] = $object->getID();
$repo = $object->getRepository();
} else if ($object instanceof PhabricatorRepositoryCommit) {
- $results['commit'] = $object->getCommitIdentifier();
+ $results['buildable.commit'] = $object->getCommitIdentifier();
$repo = $object->getRepository();
}
- $results['repository'] = $repo->getCallsign();
- $results['vcs'] = $repo->getVersionControlSystem();
- $results['uri'] = $repo->getPublicRemoteURI();
- $results['timestamp'] = time();
+ $results['repository.callsign'] = $repo->getCallsign();
+ $results['repository.vcs'] = $repo->getVersionControlSystem();
+ $results['repository.uri'] = $repo->getPublicRemoteURI();
+ $results['step.timestamp'] = time();
+ $results['build.id'] = $build->getID();
return $results;
}
@@ -44,12 +46,17 @@
public function getAvailableVariables() {
return array(
- 'revision' => pht('The differential revision ID, if applicable.'),
- 'commit' => pht('The commit identifier, if applicable.'),
- 'repository' => pht('The callsign of the repository in Phabricator.'),
- 'vcs' => pht('The version control system, either "svn", "hg" or "git".'),
- 'uri' => pht('The URI to clone or checkout the repository from.'),
- 'timestamp' => pht('The current UNIX timestamp.'));
+ 'buildable.revision' =>
+ pht('The differential revision ID, if applicable.'),
+ 'buildable.commit' => pht('The commit identifier, if applicable.'),
+ 'repository.callsign' =>
+ pht('The callsign of the repository in Phabricator.'),
+ 'repository.vcs' =>
+ pht('The version control system, either "svn", "hg" or "git".'),
+ 'repository.uri' =>
+ pht('The URI to clone or checkout the repository from.'),
+ 'step.timestamp' => pht('The current UNIX timestamp.'),
+ 'build.id' => pht('The ID of the current build.'));
}
public function getSettingRemarkupInstructions() {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 12:41 AM (12 h, 40 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721140
Default Alt Text
D7540.diff (4 KB)

Event Timeline