From 71c2916284d82cdcdb9ba7122d7f420325d32a2b Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Mon, 4 Nov 2024 15:03:09 +0100 Subject: [PATCH] handle config file from checkout to prevent false isLaunched status --- recipe/deployTasks.php | 19 ++++++++++++++++++- recipe/hooks.php | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/recipe/deployTasks.php b/recipe/deployTasks.php index 3278c92..d98af21 100644 --- a/recipe/deployTasks.php +++ b/recipe/deployTasks.php @@ -2,7 +2,24 @@ namespace Deployer; +task('deploy:d3OxidBeforeVendorsTasks', [ + 'deploy:oxid_backup_configfile' +]); + +task('deploy:oxid_backup_configfile', function() { + if (test('[ -f {{release_path}}/source/config.inc.php ]')) { + run('mv {{release_path}}/source/config.inc.php {{release_path}}/source/config.deployment.inc.php'); + } +}); + desc('Oxid related tasks'); -task('deploy:d3OxidTasks', [ +task('deploy:d3OxidAfterVendorTasks', [ + 'deploy:oxid_restore_configfile', 'deploy:clear_paths' ]); + +task('deploy:oxid_restore_configfile', function() { + if (test('[ -f {{release_path}}/source/config.deployment.inc.php ]')) { + run('mv {{release_path}}/source/config.deployment.inc.php {{release_path}}/source/config.inc.php'); + } +}); diff --git a/recipe/hooks.php b/recipe/hooks.php index 467b9c4..42c77b7 100644 --- a/recipe/hooks.php +++ b/recipe/hooks.php @@ -3,4 +3,5 @@ namespace Deployer; after('deploy:failed', 'deploy:unlock'); -after('deploy:vendors', 'deploy:d3OxidTasks'); +before('deploy:vendors', 'deploy:d3OxidBeforeVendorsTasks'); +after('deploy:vendors', 'deploy:d3OxidAfterVendorTasks');