Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F80101
D7539.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7539.diff
View Options
diff --git a/src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php b/src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
--- a/src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
+++ b/src/applications/harbormaster/step/RemoteCommandBuildStepImplementation.php
@@ -26,20 +26,38 @@
$settings = $this->getSettings();
+ $parameters = array();
+ $matches = array();
+ $variables = $this->retrieveVariablesFromBuild($build);
+ $command = $settings['command'];
+ preg_match_all(
+ "/\\\$\\{(?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 = vcsprintf(
+ $command,
+ $parameters);
+
$future = null;
if (empty($settings['sshkey'])) {
$future = new ExecFuture(
'ssh -o "StrictHostKeyChecking no" -p %s %s %s',
$settings['sshport'],
$settings['sshuser'].'@'.$settings['sshhost'],
- $this->mergeVariables($build, $settings['command']));
+ $command);
} else {
$future = new ExecFuture(
'ssh -o "StrictHostKeyChecking no" -p %s -i %s %s %s',
$settings['sshport'],
$settings['sshkey'],
$settings['sshuser'].'@'.$settings['sshhost'],
- $this->mergeVariables($build, $settings['command']));
+ $command);
}
$log_stdout = $build->createLog($build_step, "remote", "stdout");
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/l3/dk/4nnx2lsdbj2tlurh
Default Alt Text
D7539.diff (1 KB)
Attached To
Mode
D7539: Put back the stronger variable replacement
Attached
Detach File
Event Timeline
Log In to Comment