Adding support for building specific revisions, rather than just branches
This commit is contained in:
parent
52976a66ef
commit
43ecd57775
|
@ -35,8 +35,7 @@ class RemoteGitBuild extends Build
|
||||||
public function createWorkingCopy(Builder $builder, $buildPath)
|
public function createWorkingCopy(Builder $builder, $buildPath)
|
||||||
{
|
{
|
||||||
$yamlParser = new YamlParser();
|
$yamlParser = new YamlParser();
|
||||||
$success = true;
|
$key = trim($this->getProject()->getGitKey());
|
||||||
$key = trim($this->getProject()->getGitKey());
|
|
||||||
|
|
||||||
if (!empty($key)) {
|
if (!empty($key)) {
|
||||||
$success = $this->cloneBySsh($builder, $buildPath);
|
$success = $this->cloneBySsh($builder, $buildPath);
|
||||||
|
@ -88,6 +87,7 @@ class RemoteGitBuild extends Build
|
||||||
// Use the key file to do an SSH clone:
|
// 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';
|
$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);
|
$success = $builder->executeCommand($cmd, $keyFile, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
|
||||||
|
$builder->executeCommand('cd "%s" && git checkout %s', $cloneTo, $this->getCommitId());
|
||||||
|
|
||||||
// Remove the key file:
|
// Remove the key file:
|
||||||
unlink($keyFile);
|
unlink($keyFile);
|
||||||
|
|
Loading…
Reference in a new issue