From f04beb142e4df3e876d7063f864b8b82ac6bf5f3 Mon Sep 17 00:00:00 2001 From: ihsanudin Date: Tue, 9 Jun 2015 17:03:04 +0700 Subject: [PATCH 01/13] add front controller cleaning task --- .../Symfony2/FrontControllerCleanTask.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php diff --git a/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php b/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php new file mode 100644 index 0000000..1038150 --- /dev/null +++ b/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php @@ -0,0 +1,23 @@ + + */ +class FrontControllerCleanTask extends AbstractTask +{ + public function getName() + { + return 'Cleaning Project'; + } + + public function run() + { + $command = 'rm -rf web/app_*.php'; + $result = $this->runCommandRemote($command); + + return $result; + } +} \ No newline at end of file From 59c539a1ba15c52afd98e283148ea8a24f56bf30 Mon Sep 17 00:00:00 2001 From: Muhamad Surya Iksanudin Date: Wed, 10 Jun 2015 06:18:08 +0700 Subject: [PATCH 02/13] Fix PSR-2 Fix PSR-2 code style --- Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php b/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php index 1038150..7a0032f 100644 --- a/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php +++ b/Mage/Task/BuiltIn/Symfony2/FrontControllerCleanTask.php @@ -20,4 +20,4 @@ class FrontControllerCleanTask extends AbstractTask return $result; } -} \ No newline at end of file +} From fa722b553d03a2bdbaa9788f1979c07cd76ba029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Huet?= Date: Fri, 7 Aug 2015 17:35:22 +0200 Subject: [PATCH 03/13] fixing php54 array syntax --- Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php b/Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php index 2682b86..e7010cb 100644 --- a/Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php +++ b/Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php @@ -147,6 +147,6 @@ class LinkSharedFilesTask extends AbstractTask implements IsReleaseAware $path = $linkedEntity; } - return [$path, $strategy]; + return array($path, $strategy); } } From cc8c3068fe65361973cc466058868b633138616f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Huet?= Date: Fri, 7 Aug 2015 17:56:47 +0200 Subject: [PATCH 04/13] A task to create a simple symbolic link --- Mage/Task/BuiltIn/Filesystem/SymlinkTask.php | 139 +++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Mage/Task/BuiltIn/Filesystem/SymlinkTask.php diff --git a/Mage/Task/BuiltIn/Filesystem/SymlinkTask.php b/Mage/Task/BuiltIn/Filesystem/SymlinkTask.php new file mode 100644 index 0000000..28911a7 --- /dev/null +++ b/Mage/Task/BuiltIn/Filesystem/SymlinkTask.php @@ -0,0 +1,139 @@ + + */ +class SymlinkTask extends AbstractTask +{ + /** + * The name of the symlink including full path to it. + * + * If the stage is on local host you should give full paths. If on remote + * you may give full or relative to the current release directory paths. + * + * @var string + */ + private $link; + + /** + * The target to wich the symlink should point to including full path to it. + * + * If the stage is on local host you should give full paths. If on remote + * you may give full or relative to the current release directory paths. + * + * @var string + */ + private $target; + + /** + * Initialize parameters. + * + * @throws RequiredConfigNotFoundException + */ + public function init() + { + parent::init(); + + if (! $this->getParameter('target')) { + throw new RequiredConfigNotFoundException('Missing required target link.'); + } + + $this->setTarget($this->getParameter('target')); + if (!is_null($this->getParameter('link'))) { + $this->setLink($this->getParameter('link')); + } + } + + /** + * @return string + */ + public function getName() + { + return "Creating symbolic link [built-in]"; + } + + /** + * @return boolean + */ + public function run() + { + $command = 'ln -fs ' . $this->getAbsolutPath($this->getTarget()); + if ($this->getLink()) { + $command .= ' ' . $this->getAbsolutPath($this->getLink()); + } + + $result = $this->runCommand($command); + + return $result; + } + + /** + * @param string $path + * @return string + */ + public function getAbsolutPath($path) + { + // For release + if ($this->getStage() != 'pre-deploy' && $path[0] != '/' && $this->getConfig()->deployment('to')) { + $releasesDirectory = trim($this->getConfig()->release('directory', 'releases'), '/') . '/' . $this->getConfig()->getReleaseId(); + return rtrim($this->getConfig()->deployment('to'), '/') . '/' . $releasesDirectory . '/' . ltrim($path, '/'); + } + + return $path; + } + + /** + * Set link. + * + * @param string $link + * @return SymlinkTask + */ + protected function setLink($link) + { + $this->link = $link; + + return $this; + } + + /** + * @return string + */ + protected function getLink() + { + return $this->link; + } + + /** + * Set target. + * + * @param string $target + * @return SymlinkTask + */ + protected function setTarget($target) + { + $this->target = $target; + + return $this; + } + + /** + * @return string + */ + protected function getTarget() + { + return $this->target; + } +} From 7e6420f55e5557a05b3bae73f38cd0fadae6dc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dieding?= Date: Tue, 18 Aug 2015 09:35:30 +0200 Subject: [PATCH 05/13] Rsny fails with Host key verification failed. Add StrictHostKeyChecking policy from AbstractTask --- Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php index 16804b0..d0ee3d4 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php @@ -96,7 +96,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') . ' ' From 81a8ccdeb811ad43475eec651ec807e96422fafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Huet?= Date: Wed, 21 Oct 2015 17:01:41 +0200 Subject: [PATCH 06/13] git local commands should be executed in the deployment:from directory bis --- Mage/Task/BuiltIn/Scm/ChangeBranchTask.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php b/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php index 36c27ea..cb764da 100644 --- a/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php +++ b/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php @@ -77,7 +77,7 @@ class ChangeBranchTask extends AbstractTask $scmData = $this->getConfig()->deployment('scm', false); if ($result && is_array($scmData) && isset($scmData['branch']) && $scmData['branch'] != $currentBranch) { - $command = 'git branch | grep \'' . $scmData['branch'] . '\' | tr -s \' \' | sed \'s/^[ ]//g\''; + $command = $preCommand . 'git branch | grep \'' . $scmData['branch'] . '\' | tr -s \' \' | sed \'s/^[ ]//g\''; $isBranchTracked = ''; $result = $this->runCommandLocal($command, $isBranchTracked); @@ -86,7 +86,7 @@ class ChangeBranchTask extends AbstractTask } $branch = $this->getParameter('branch', $scmData['branch']); - $command = 'git checkout ' . $branch; + $command = $preCommand . 'git checkout ' . $branch; $result = $this->runCommandLocal($command) && $result; self::$startingBranch = $currentBranch; From ab4cbeafbd9808540f3a839b278bb0cc036d7426 Mon Sep 17 00:00:00 2001 From: Renaud LITTOLFF Date: Wed, 13 Jan 2016 11:52:19 +0100 Subject: [PATCH 07/13] Escape targz excludes to allow wildcard --- Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php index 1f741a2..0c60e39 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php @@ -46,8 +46,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'); @@ -65,6 +64,10 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware $remoteTarGz = basename($localTarGz); $excludeCmd = ''; foreach ($excludes as $excludeFile) { + if (strpos($excludeFile, '*') !== false) { + $excludeFile = '"' . $excludeFile . '"'; + } + $excludeCmd .= ' --exclude=' . $excludeFile; } From 37d28e57cd1626d70efcbade1fd4e0dcc45b3ae7 Mon Sep 17 00:00:00 2001 From: Mike Tralala Date: Mon, 7 Mar 2016 16:59:13 +0100 Subject: [PATCH 08/13] Change the point the current branch is saved. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is necessary to save to reverse back to the right branch if another branch is used than 'master' and you´re currently working in the deployed branch. --- Mage/Task/BuiltIn/Scm/ChangeBranchTask.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php b/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php index 36c27ea..fb98217 100644 --- a/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php +++ b/Mage/Task/BuiltIn/Scm/ChangeBranchTask.php @@ -73,6 +73,8 @@ class ChangeBranchTask extends AbstractTask $command = $preCommand . 'git branch | grep \'*\' | cut -d\' \' -f 2'; $currentBranch = 'master'; $result = $this->runCommandLocal($command, $currentBranch); + + self::$startingBranch = $currentBranch; $scmData = $this->getConfig()->deployment('scm', false); @@ -88,8 +90,6 @@ class ChangeBranchTask extends AbstractTask $branch = $this->getParameter('branch', $scmData['branch']); $command = 'git checkout ' . $branch; $result = $this->runCommandLocal($command) && $result; - - self::$startingBranch = $currentBranch; } else { throw new SkipException; } From 384247bcd994cd59d16360ec4158b482a3a72cf4 Mon Sep 17 00:00:00 2001 From: Marcel Hernandez Date: Fri, 18 Mar 2016 14:12:43 +0100 Subject: [PATCH 09/13] Fix regression: custom tasks not found --- bin/mage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/mage b/bin/mage index aff9e5e..8d134f2 100755 --- a/bin/mage +++ b/bin/mage @@ -22,12 +22,12 @@ if (file_exists(__DIR__ . '/../vendor/autoload.php')) { require_once __DIR__ . '/../vendor/autoload.php'; } else if (file_exists(__DIR__ . '/../../../autoload.php')) { require_once __DIR__ . '/../../../autoload.php'; -} else { - require_once $baseDir . '/Mage/Autoload.php'; - $loader = new \Mage\Autoload(); - spl_autoload_register(array($loader, 'autoLoad')); } +require_once $baseDir . '/Mage/Autoload.php'; +$loader = new \Mage\Autoload(); +spl_autoload_register(array($loader, 'autoLoad')); + // Clean arguments array_shift($argv); From 08a293f8cdf4e4d7f5cd4fd5cb2afbd402e3760c Mon Sep 17 00:00:00 2001 From: Marcel Hernandez Date: Fri, 18 Mar 2016 14:57:15 +0100 Subject: [PATCH 10/13] Something is wrong with the 2.6.4 release of the symfony/config component which prevents the "composer install --prefer-source" command from working and crashes the Travis build. Bumped all Symfony Component releases to next minor version (2.6.5) --- composer.lock | 85 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/composer.lock b/composer.lock index 7d89680..bed73c7 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], "hash": "caa09089c7b57461ed42e97a4449f2c6", + "content-hash": "f96bb31fc6bb681d0a03748eaf741a40", "packages": [], "packages-dev": [ { @@ -951,23 +952,26 @@ }, { "name": "symfony/config", - "version": "v2.6.4", + "version": "v2.6.5", "target-dir": "Symfony/Component/Config", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408" + "url": "https://github.com/symfony/config.git", + "reference": "8e0a8b5eddc606f6232dd9107e4adec69ed8721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/a9f781ba1221067d1f07c8cec0bc50f81b8d7408", - "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408", + "url": "https://api.github.com/repos/symfony/config/zipball/8e0a8b5eddc606f6232dd9107e4adec69ed8721e", + "reference": "8e0a8b5eddc606f6232dd9107e4adec69ed8721e", "shasum": "" }, "require": { "php": ">=5.3.3", "symfony/filesystem": "~2.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -995,21 +999,21 @@ ], "description": "Symfony Config Component", "homepage": "http://symfony.com", - "time": "2015-01-21 20:57:55" + "time": "2015-03-12 10:28:44" }, { "name": "symfony/console", - "version": "v2.6.4", + "version": "v2.6.5", "target-dir": "Symfony/Component/Console", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34" + "url": "https://github.com/symfony/console.git", + "reference": "53f86497ccd01677e22435cfb7262599450a90d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/e44154bfe3e41e8267d7a3794cd9da9a51cfac34", - "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "url": "https://api.github.com/repos/symfony/console/zipball/53f86497ccd01677e22435cfb7262599450a90d1", + "reference": "53f86497ccd01677e22435cfb7262599450a90d1", "shasum": "" }, "require": { @@ -1018,6 +1022,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.1", + "symfony/phpunit-bridge": "~2.7", "symfony/process": "~2.1" }, "suggest": { @@ -1052,21 +1057,21 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "time": "2015-03-13 17:37:22" }, { "name": "symfony/event-dispatcher", - "version": "v2.6.4", + "version": "v2.6.5", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f75989f3ab2743a82fe0b03ded2598a2b1546813", - "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", + "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", "shasum": "" }, "require": { @@ -1077,6 +1082,7 @@ "symfony/config": "~2.0,>=2.0.5", "symfony/dependency-injection": "~2.6", "symfony/expression-language": "~2.6", + "symfony/phpunit-bridge": "~2.7", "symfony/stopwatch": "~2.3" }, "suggest": { @@ -1110,26 +1116,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2015-02-01 16:10:57" + "time": "2015-03-13 17:37:22" }, { "name": "symfony/filesystem", - "version": "v2.6.4", + "version": "v2.6.5", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" + "url": "https://github.com/symfony/filesystem.git", + "reference": "fdc5f151bc2db066b51870d5bea3773d915ced0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", - "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fdc5f151bc2db066b51870d5bea3773d915ced0b", + "reference": "fdc5f151bc2db066b51870d5bea3773d915ced0b", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -1157,26 +1166,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2015-01-03 21:13:09" + "time": "2015-03-12 10:28:44" }, { "name": "symfony/stopwatch", - "version": "v2.6.4", + "version": "v2.6.5", "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c" + "reference": "ba4e774f71e2ce3e3f65cabac4031b9029972af5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", - "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/ba4e774f71e2ce3e3f65cabac4031b9029972af5", + "reference": "ba4e774f71e2ce3e3f65cabac4031b9029972af5", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -1204,26 +1216,29 @@ ], "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", - "time": "2015-01-03 08:01:59" + "time": "2015-02-24 11:52:21" }, { "name": "symfony/yaml", - "version": "v2.6.1", + "version": "v2.6.5", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + "reference": "0cd8e72071e46e15fc072270ae39ea1b66b10a9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/0cd8e72071e46e15fc072270ae39ea1b66b10a9d", + "reference": "0cd8e72071e46e15fc072270ae39ea1b66b10a9d", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -1251,7 +1266,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-03-12 10:28:44" } ], "aliases": [], From ddaf2f0a01075a5347d3f74f4ac85d6b0b6c9ebb Mon Sep 17 00:00:00 2001 From: Kevin Robatel Date: Mon, 11 Apr 2016 16:28:15 +0200 Subject: [PATCH 11/13] Allow `source -> temporal` to be absent in the config --- Mage/Task/BuiltIn/Scm/CloneTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/Task/BuiltIn/Scm/CloneTask.php b/Mage/Task/BuiltIn/Scm/CloneTask.php index 5402117..27d09a7 100644 --- a/Mage/Task/BuiltIn/Scm/CloneTask.php +++ b/Mage/Task/BuiltIn/Scm/CloneTask.php @@ -56,7 +56,7 @@ class CloneTask extends AbstractTask // Create temporal directory for clone if (is_array($this->source)) { - if (trim($this->source['temporal']) == '') { + if (!isset($this->source['temporal']) || trim($this->source['temporal']) == '') { $this->source['temporal'] = sys_get_temp_dir(); } $this->source['temporal'] = rtrim($this->source['temporal'], '/') . '/' . md5(microtime()) . '/'; From 3956aa153da2bfa4921b5b72fef2f67239142763 Mon Sep 17 00:00:00 2001 From: schauer Date: Wed, 9 Nov 2016 15:59:45 +0100 Subject: [PATCH 12/13] Update PHP version Using short array syntax is allowed in PHP 5.4 only: https://github.com/andres-montanez/Magallanes/blob/master/Mage/Task/BuiltIn/Filesystem/ApplyFaclsTask.php#L36 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a8b9d75..5be1dd8 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "type": "library", "keywords": ["deployment"], "require": { - "php": ">=5.3" + "php": ">=5.4" }, "require-dev": { "phpunit/phpunit": "4.3.5", From 7b3114498cc64caec54cc1cf80f2dd061cd3625e Mon Sep 17 00:00:00 2001 From: Sid Date: Mon, 26 Dec 2016 20:07:10 +1300 Subject: [PATCH 13/13] Detect and remove "Identity added:" line from the remote server. --- Mage/Task/BuiltIn/Deployment/ReleaseTask.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Mage/Task/BuiltIn/Deployment/ReleaseTask.php b/Mage/Task/BuiltIn/Deployment/ReleaseTask.php index 93df8cf..7d6b72d 100644 --- a/Mage/Task/BuiltIn/Deployment/ReleaseTask.php +++ b/Mage/Task/BuiltIn/Deployment/ReleaseTask.php @@ -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);