diff --git a/composer.json b/composer.json index f572378..3a7f79e 100644 --- a/composer.json +++ b/composer.json @@ -10,15 +10,15 @@ } ], "require": { - "php": ">=7.4", - "deployer/deployer": "^6.8", - "symfony/finder": "^4.4 || ^5.4 || ^6.0", + "php": ">=8.2", + "deployer/deployer": "^7.5", + "symfony/finder": "^7.0", "webmozart/assert": "^1.11" }, "require-dev": { - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18", - "setono/code-quality-pack": "^2.4" + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.19", + "setono/code-quality-pack": "^2.8" }, "prefer-stable": true, "autoload": { diff --git a/src/recipe/setono_supervisor.php b/src/recipe/setono_supervisor.php index 799d47f..36f169d 100644 --- a/src/recipe/setono_supervisor.php +++ b/src/recipe/setono_supervisor.php @@ -12,6 +12,6 @@ before('supervisor:upload', 'supervisor:stop'); before('deploy:symlink', 'supervisor:upload'); -after('success', 'supervisor:start'); +after('deploy:success', 'supervisor:start'); after('deploy:failed', 'supervisor:start'); after('rollback', 'supervisor:start'); diff --git a/src/task/setono_supervisor.php b/src/task/setono_supervisor.php index 6bba4fd..4836072 100644 --- a/src/task/setono_supervisor.php +++ b/src/task/setono_supervisor.php @@ -5,7 +5,7 @@ namespace Setono\Deployer\Supervisor; use function Deployer\get; -use function Deployer\locateBinaryPath; +use function Deployer\which; use function Deployer\run; use function Deployer\set; use function Deployer\task; @@ -17,7 +17,7 @@ * The supervisor(ctl) binary */ set('bin/supervisor', static function (): string { - $binary = locateBinaryPath('supervisorctl'); + $binary = which('supervisorctl'); Assert::string($binary); return $binary; @@ -115,3 +115,7 @@ run('{{bin/supervisor}} start all'); } })->desc('Starts all services managed by Supervisor'); + +task('supervisor:install', function () { + run('apt-get install -y supervisor', env: ['DEBIAN_FRONTEND' => 'noninteractive'], timeout: 900); +})->desc('Installs supervisor on the host');