Merge branch 'master' into develop

This commit is contained in:
Andrés Montañez
2017-01-05 22:56:11 -03:00
11 changed files with 1233 additions and 1279 deletions
@@ -61,6 +61,26 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
// and awk parameters need special care depending on the executing shell
$resultFetch = $this->runCommandRemote("ls -ld .", $directoryInfos);
if (!empty($directoryInfos)) {
// break $directoryInfos by line break
// to exclude unwanted line(s)
$lines = explode("\n", $directoryInfos);
$filtered_lines = array();
foreach ($lines as $line) {
// exclude line that starts with 'Identity added'
// e.g.: from ssh with ProxyCommand / proxy jump
if (stripos($line, "Identity added") !== FALSE) {
continue;
}
$filtered_lines[] = $line;
}
// reconstruct $directoryInfos using the filtered lines
$directoryInfos = implode("\n", $filtered_lines);
//uniformize format as it depends on the system deployed on
$directoryInfos = trim(str_replace(array(" ", "\t"), ' ', $directoryInfos));
$infoArray = explode(' ', $directoryInfos);
@@ -95,7 +95,7 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
$command = 'rsync -avz '
. $strategyFlags . ' '
. '--rsh="ssh ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
. '--rsh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
. $this->excludes($excludes) . ' '
. $this->excludesListFile($excludesListFilePath) . ' '
. $this->getConfig()->deployment('from') . ' '
@@ -45,8 +45,7 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
$this->checkOverrideRelease();
$excludes = $this->getExcludes();
$excludesListFilePath = $this->getConfig()->deployment('excludes_file', '');
;
$excludesListFilePath = $this->getConfig()->deployment('excludes_file', '');
// If we are working with releases
$deployToDirectory = $this->getConfig()->deployment('to');
@@ -64,6 +63,10 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
$remoteTarGz = basename($localTarGz);
$excludeCmd = '';
foreach ($excludes as $excludeFile) {
if (strpos($excludeFile, '*') !== false) {
$excludeFile = '"' . $excludeFile . '"';
}
$excludeCmd .= ' --exclude=' . $excludeFile;
}