ew_deployer_config/Classes/Tasks/Deploy.php
2025-04-18 14:11:54 +02:00

61 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace Evoweb\DeployerConfig\Tasks;
use function Deployer\after;
class Deploy extends AbstractTasks
{
protected array $tasks = [
'deploy:prepare' => [
'local:info',
'local:setup',
'remote:prepare',
'rsync:warmup',
'local:lock',
'local:release',
'local:update_code',
'local:env',
'local:shared',
'local:writable',
'local:write_release',
'local:vendors',
],
'deploy:publish' => [
'local:clear_paths',
'local:symlink',
'local:cleanup',
'rsync:remote',
'remote:change_group',
'remote:writable',
'remote:db_compare',
'remote:fix_folder_structure',
'rsync:switch_current',
'remote:clear_cache',
'remote:clear_opcache',
'local:echo_release_number',
'local:unlock',
'deploy:success',
],
'deploy' => [
'deploy:prepare',
'deploy:publish',
]
];
protected function initializeTasks(): void
{
array_walk($this->tasks, [$this, 'registerTask']);
$this->registerAfterTask();
}
protected function registerAfterTask(): void
{
after('deploy:failed', 'local:unlock');
}
}