Added a new configuration variable, PHPCI_BUILD_ROOT_DI.
This variable allows to change where the build happens. It defaults to PHPCI_DIR.'PHPCI/build/'. Moved build path calculate and build removal into the Build class. Also remove the build directory when deleting the build. Close #834
This commit is contained in:
parent
4083fcd9b6
commit
ccdc73326d
5 changed files with 37 additions and 26 deletions
|
|
@ -217,4 +217,28 @@ class Build extends BuildBase
|
|||
{
|
||||
return array($builder, $file, $line, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the path to run this build into.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBuildPath()
|
||||
{
|
||||
return PHPCI_BUILD_ROOT_DIR . $this->getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the build directory.
|
||||
*/
|
||||
public function removeBuildDirectory()
|
||||
{
|
||||
$buildPath = $this->getBuildPath();
|
||||
|
||||
if (!is_dir($buildPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue