cod consolidation and style updates
This commit is contained in:
+15
-1
@@ -50,7 +50,21 @@ task('artisan:clear', function (): void {
|
||||
task('services:restart', function (): void {
|
||||
run('sudo -n nginx -t');
|
||||
run('sudo -n systemctl reload nginx');
|
||||
run('sudo -n systemctl restart php8.3-fpm');
|
||||
$phpFpm = run(<<<'BASH'
|
||||
if systemctl list-unit-files php8.5-fpm.service --no-legend | grep -q '^php8.5-fpm.service'; then
|
||||
echo php8.5-fpm
|
||||
elif systemctl list-unit-files php8.3-fpm.service --no-legend | grep -q '^php8.3-fpm.service'; then
|
||||
echo php8.3-fpm
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
BASH);
|
||||
$phpFpm = trim($phpFpm);
|
||||
if ($phpFpm === '') {
|
||||
throw new \RuntimeException('No supported PHP-FPM service found (8.5 or 8.3).');
|
||||
}
|
||||
writeln("Restarting {$phpFpm}...");
|
||||
run("sudo -n systemctl restart {$phpFpm}");
|
||||
});
|
||||
|
||||
after('deploy:update_code', 'deploy:write_revision_file');
|
||||
|
||||
Reference in New Issue
Block a user