This commit is contained in:
Mark Gregory
2026-10-19 14:11:28 +01:00
parent 26a2b448a5
commit ac0c5410c1
128 changed files with 5593 additions and 217 deletions
+19 -5
View File
@@ -9,7 +9,7 @@ set('writable_use_sudo', true);
set('clear_use_sudo', true);
set('cleanup_use_sudo', true);
set('keep_releases', 1);
set('repository', 'git@git.absdev.net:admin/RSync-Studio.git');
set('repository', 'git@git.absdev.net:mag/rsync_licensing_server.git');
set('node_version', '22.12.0');
set('allow_anonymous_stats', false);
@@ -18,8 +18,8 @@ add('shared_dirs', ['storage']);
add('writable_dirs', ['storage', 'bootstrap/cache']);
// Host Definitions
host('main')
->set('hostname', 'rsyncstudio.absdev.net')
host('prod')
->set('hostname', 'rsyncs.absdev.net')
->set('remote_user', 'mag')
->set('branch', 'main')
->set('deploy_path', '/var/www/rsyncstudio');
@@ -28,7 +28,7 @@ host('stage')
->set('hostname', 'pegasus.absdev.net')
->set('remote_user', 'mag')
->set('branch', 'stage')
->set('deploy_path', '/var/www/rsyncstudio');
->set('deploy_path', '/var/www/rsyncstudio_dev');
task('build', function (): void {
run('export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm use {{node_version}} && cd {{release_path}} && npm ci --no-audit --no-fund');
@@ -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');