diff --git a/PHPCI/Model/Build/RemoteGitBuild.php b/PHPCI/Model/Build/RemoteGitBuild.php index 399433a3..0670f6db 100644 --- a/PHPCI/Model/Build/RemoteGitBuild.php +++ b/PHPCI/Model/Build/RemoteGitBuild.php @@ -76,8 +76,8 @@ abstract class RemoteGitBuild extends Build chmod($keyFile, 0600); // Use the key file to do an SSH clone: - $cmd = 'ssh-agent ssh-add "%s" && git clone -b %s %s "%s" && ssh-agent -k'; - $success = $builder->executeCommand($cmd, $keyFile, $build->getBranch(), $this->getCloneUrl(), $to); + $cmd = 'eval `ssh-agent -s` && ssh-add "%s" && git clone -b %s %s "%s" && ssh-agent -k'; + $success = $builder->executeCommand($cmd, $keyFile, $this->getBranch(), $this->getCloneUrl(), $to); // Remove the key file: unlink($keyFile);