ew_deployer_config/Classes/Tasks/Deploy.php
2025-04-17 20:53:18 +02:00

58 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:create_folder',
'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',
],
];
public function __construct()
{
parent::__construct();
$this->registerAfterTask();
}
protected function registerAfterTask(): void
{
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'local:unlock');
}
}