Adding support for building specific revisions, rather than just branches

This commit is contained in:
Dan Cryer 2014-02-24 20:28:18 +00:00
parent 52976a66ef
commit 43ecd57775

View file

@ -35,8 +35,7 @@ class RemoteGitBuild extends Build
public function createWorkingCopy(Builder $builder, $buildPath)
{
$yamlParser = new YamlParser();
$success = true;
$key = trim($this->getProject()->getGitKey());
$key = trim($this->getProject()->getGitKey());
if (!empty($key)) {
$success = $this->cloneBySsh($builder, $buildPath);
@ -88,6 +87,7 @@ class RemoteGitBuild extends Build
// Use the key file to do an SSH clone:
$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(), $cloneTo);
$builder->executeCommand('cd "%s" && git checkout %s', $cloneTo, $this->getCommitId());
// Remove the key file:
unlink($keyFile);