mirror of
https://github.com/hauke68/Magallanes.git
synced 2025-09-13 12:40:18 +02:00
Tweak clones.
This commit is contained in:
parent
e40b7d21c9
commit
2deaa27a2a
@ -121,29 +121,6 @@ class Config
|
|||||||
return $this->parseConfigFile($filePath);
|
return $this->parseConfigFile($filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Obviously this method is a HACK. It was refactored from ::loadEnvironment()
|
|
||||||
* TODO Please put it to SCM functionality.
|
|
||||||
*
|
|
||||||
* @param array $settings
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
protected function updateSCMTempDir(array $settings)
|
|
||||||
{
|
|
||||||
// Create temporal directory for clone
|
|
||||||
if (isset($settings['deployment']['source']) && is_array($settings['deployment']['source'])) {
|
|
||||||
if (trim($settings['deployment']['source']['temporal']) == '') {
|
|
||||||
$settings['deployment']['source']['temporal'] = sys_get_temp_dir();
|
|
||||||
}
|
|
||||||
$settings['deployment']['source']['temporal']
|
|
||||||
= rtrim($settings['deployment']['source']['temporal'], '/') . '/' . md5(microtime()) . '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the Environment configuration
|
* Loads the Environment configuration
|
||||||
* @param $filePath string
|
* @param $filePath string
|
||||||
@ -156,9 +133,6 @@ class Config
|
|||||||
|
|
||||||
$settings = $this->parseConfigFile($filePath);
|
$settings = $this->parseConfigFile($filePath);
|
||||||
|
|
||||||
//this is a HACK in the old code - no time to remove it now, so I factored it out in own method
|
|
||||||
$settings = $this->updateSCMTempDir($settings);
|
|
||||||
|
|
||||||
return $settings;
|
return $settings;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -490,6 +464,11 @@ class Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setSourceTemporal($directory)
|
||||||
|
{
|
||||||
|
$this->environmentConfig['deployment']['source']['temporal'] = $directory;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Releasing Options
|
* Returns Releasing Options
|
||||||
*
|
*
|
||||||
|
@ -26,7 +26,6 @@ use SplFileInfo;
|
|||||||
class Console
|
class Console
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* TODO refactor into own static class
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $paramsNotRequiringEnvironment = array('install' => 'install', 'upgrade' => 'upgrade', 'version' => 'version');
|
public static $paramsNotRequiringEnvironment = array('install' => 'install', 'upgrade' => 'upgrade', 'version' => 'version');
|
||||||
|
@ -133,7 +133,7 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
|
|||||||
$directoryToDelete = $releasesDirectory . '/' . $releaseIdToDelete;
|
$directoryToDelete = $releasesDirectory . '/' . $releaseIdToDelete;
|
||||||
if ($directoryToDelete != '/') {
|
if ($directoryToDelete != '/') {
|
||||||
$command = 'rm -rf ' . $directoryToDelete;
|
$command = 'rm -rf ' . $directoryToDelete;
|
||||||
$result = $result && $this->runCommandRemote($command);
|
$result = $this->runCommandRemote($command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,15 @@ class CloneTask extends AbstractTask
|
|||||||
$this->name = 'SCM Clone (GIT) [built-in]';
|
$this->name = 'SCM Clone (GIT) [built-in]';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create temporal directory for clone
|
||||||
|
if (is_array($this->source)) {
|
||||||
|
if (trim($this->source['temporal']) == '') {
|
||||||
|
$this->source['temporal'] = sys_get_temp_dir();
|
||||||
|
}
|
||||||
|
$this->source['temporal'] = rtrim($this->source['temporal'], '/') . '/' . md5(microtime()) . '/';
|
||||||
|
$this->getConfig()->setSourceTemporal($this->source['temporal']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user