From 9cf74f7089d624a9043b1dab4aa7e4ca16039fbe Mon Sep 17 00:00:00 2001 From: Stephan Maximilian Huber Date: Thu, 12 Sep 2019 14:49:28 +0200 Subject: [PATCH 1/2] Add support sql-sanitize for reset task, bugfix for exception. --- src/Method/DockerMethod.php | 2 +- src/Method/DrushMethod.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Method/DockerMethod.php b/src/Method/DockerMethod.php index 06a6a9a1..afb487cb 100644 --- a/src/Method/DockerMethod.php +++ b/src/Method/DockerMethod.php @@ -173,7 +173,7 @@ private function runTaskImpl(HostConfig $host_config, TaskContextInterface $cont /** @var CommandResult $cr */ $cr = $context->getResult('commandResult', false); - if ($cr->failed()) { + if ($cr && $cr->failed()) { $cr->throwException(sprintf('Docker task `%s` failed!', $task)); } } diff --git a/src/Method/DrushMethod.php b/src/Method/DrushMethod.php index a6d61ea8..b0f1e1a9 100644 --- a/src/Method/DrushMethod.php +++ b/src/Method/DrushMethod.php @@ -94,6 +94,8 @@ public function getDefaultConfig(ConfigurationService $configuration_service, ar ? 9 : $configuration_service->getSetting('drushVersion', 8); + $config['sqlDumpCommand'] = 'sql-dump'; + $config['sanitizeOnReset'] = false; $config['supportsZippedBackups'] = true; $config['siteFolder'] = '/sites/default'; $config['filesFolder'] = '/sites/default/files'; @@ -175,6 +177,10 @@ public function reset(HostConfig $host_config, TaskContextInterface $context) /** @var ScriptMethod $script_method */ $script_method = $context->getConfigurationService()->getMethodFactory()->getMethod('script'); + if ($host_config->get('sanitizeOnReset', false)) { + $this->runDrush( $shell,'sql-sanitize -y'); + } + if ($host_config->isType(HostType::DEV)) { $admin_user = $host_config['adminUser']; From 13d16ec0224cc2a78903d9a042cbd2a8d04db2ef Mon Sep 17 00:00:00 2001 From: Stephan Maximilian Huber Date: Thu, 12 Sep 2019 14:52:11 +0200 Subject: [PATCH 2/2] Update changelog --- Changelog.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Changelog.md b/Changelog.md index f5edd167..bc1f30da 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.22 / 2019-09-12 + +### New + + * Add support sql-sanitize for reset task + +### Fixed + + * Fix for exception after certain docker commands. + ## 3.0.21 / 2019-08-21 ### Fixed