Fixed project directory for Build::writeSshKey and

Build::writeSshWrapper. Issue #165.
This commit is contained in:
Dmitry Khomutov 2018-03-16 06:49:35 +07:00
parent e7c4c4cc9d
commit 7747193c89
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
3 changed files with 4 additions and 4 deletions

View file

@ -472,7 +472,7 @@ class Build extends BaseBuild
*/ */
protected function writeSshKey($cloneTo) protected function writeSshKey($cloneTo)
{ {
$keyPath = dirname($cloneTo . '/temp'); $keyPath = $cloneTo . 'temp';
$keyFile = $keyPath . '.key'; $keyFile = $keyPath . '.key';
file_put_contents($keyFile, $this->getProject()->getSshPrivateKey()); file_put_contents($keyFile, $this->getProject()->getSshPrivateKey());
@ -491,7 +491,7 @@ class Build extends BaseBuild
*/ */
protected function writeSshWrapper($cloneTo, $keyFile) protected function writeSshWrapper($cloneTo, $keyFile)
{ {
$path = dirname($cloneTo . '/temp'); $path = $cloneTo . 'temp';
$wrapperFile = $path . '.sh'; $wrapperFile = $path . '.sh';
$sshFlags = '-o CheckHostIP=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o PasswordAuthentication=no'; $sshFlags = '-o CheckHostIP=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o PasswordAuthentication=no';

View file

@ -109,7 +109,7 @@ class GitBuild extends Build
} }
$cmd .= ' -b "%s" "%s" "%s"'; $cmd .= ' -b "%s" "%s" "%s"';
$cmd = 'export GIT_SSH="'.$gitSshWrapper.'" && ' . $cmd; $cmd = 'export GIT_SSH="' . $gitSshWrapper . '" && ' . $cmd;
$success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo); $success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);

View file

@ -63,7 +63,7 @@ class HgBuild extends Build
$keyFile = $this->writeSshKey($cloneTo); $keyFile = $this->writeSshKey($cloneTo);
// Do the hg clone: // Do the hg clone:
$cmd = 'hg clone --ssh "ssh -i '.$keyFile.'" %s "%s" -r %s'; $cmd = 'hg clone --ssh "ssh -i ' . $keyFile . '" %s "%s" -r %s';
$success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo, $this->getBranch()); $success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo, $this->getBranch());
if ($success) { if ($success) {