New updates for deployer

This commit is contained in:
Mark Gregory
2026-09-09 08:33:05 +01:00
parent 5b9c19c52f
commit b4aa94a389
3 changed files with 257 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@
"license": "MIT",
"require": {
"php": "^8.3",
"deployer/deployer": "^8.0",
"laravel/framework": "^13.17",
"laravel/tinker": "^3.0"
},
+196 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cda2add6397422fb1a2eb5b9207f1575",
"content-hash": "03c9ba92496a9b294eb87b214b3c0df4",
"packages": [
{
"name": "brick/math",
@@ -139,6 +139,71 @@
],
"time": "2026-09-06T14:11:38+00:00"
},
{
"name": "deployer/deployer",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/deployphp/deployer.git",
"reference": "199273500b4f14ff5eafd76bea524e5d44bcaff3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/deployphp/deployer/zipball/199273500b4f14ff5eafd76bea524e5d44bcaff3",
"reference": "199273500b4f14ff5eafd76bea524e5d44bcaff3",
"shasum": ""
},
"require": {
"maml/maml": "^3.2",
"php": "^8.3",
"symfony/console": "^7.4.0 || ^8.0.0",
"symfony/process": "^7.4.0 || ^8.0.0",
"symfony/yaml": "^7.4.0 || ^8.0.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.68",
"phpstan/phpstan": "^2.1",
"phpunit/php-code-coverage": "^12.0",
"phpunit/phpunit": "^12.5"
},
"bin": [
"bin/dep"
],
"type": "library",
"autoload": {
"files": [
"src/functions.php",
"src/Support/helpers.php"
],
"psr-4": {
"Deployer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anton Medvedev",
"email": "anton@medv.io"
}
],
"description": "Deployment Tool",
"homepage": "https://deployer.org",
"support": {
"docs": "https://deployer.org/docs",
"issues": "https://github.com/deployphp/deployer/issues",
"source": "https://github.com/deployphp/deployer"
},
"funding": [
{
"url": "https://github.com/sponsors/antonmedv",
"type": "github"
}
],
"time": "2026-05-18T16:59:34+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@@ -2034,6 +2099,60 @@
],
"time": "2026-03-08T20:05:35+00:00"
},
{
"name": "maml/maml",
"version": "v3.2.0",
"source": {
"type": "git",
"url": "https://github.com/maml-dev/maml-php.git",
"reference": "f11cdff4325bf399f23c33fc1995450e40ac0854"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maml-dev/maml-php/zipball/f11cdff4325bf399f23c33fc1995450e40ac0854",
"reference": "f11cdff4325bf399f23c33fc1995450e40ac0854",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=8.2"
},
"require-dev": {
"php-cs-fixer/shim": "^3.94",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Maml\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anton Medvedev",
"email": "anton@medv.io"
}
],
"description": "MAML Parser",
"homepage": "https://maml.dev",
"keywords": [
"config",
"configuration",
"maml",
"parser",
"serializer"
],
"support": {
"issues": "https://github.com/maml-dev/maml-php/issues",
"source": "https://github.com/maml-dev/maml-php/tree/v3.2.0"
},
"time": "2026-04-12T16:50:36+00:00"
},
{
"name": "monolog/monolog",
"version": "3.11.0",
@@ -5933,6 +6052,82 @@
],
"time": "2026-08-30T20:10:52+00:00"
},
{
"name": "symfony/yaml",
"version": "v7.4.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4cef939e55b8a21c5780418de0d98ab00d0736e1",
"reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1",
"shasum": ""
},
"require": {
"php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<6.4"
},
"require-dev": {
"symfony/console": "^6.4|^7.0|^8.0"
},
"bin": [
"Resources/bin/yaml-lint"
],
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v7.4.18"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2026-08-30T00:47:26+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
"version": "v2.4.0",
+60
View File
@@ -0,0 +1,60 @@
<?php
namespace Deployer;
require 'recipe/laravel.php';
// System Config
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('node_version', '22.12.0');
set('allow_anonymous_stats', false);
add('shared_files', ['.env']);
add('shared_dirs', ['storage']);
add('writable_dirs', ['storage', 'bootstrap/cache']);
// Host Definitions
host('main')
->set('hostname', '')
->set('remote_user', 'mag')
->set('branch', 'main')
->set('deploy_path', '/var/www/rsyncstudio');
host('stage')
->set('hostname', 'pegasus.absdev.net')
->set('remote_user', 'mag')
->set('branch', 'stage')
->set('deploy_path', '/var/www/rsyncstudio');
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');
run('export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm use {{node_version}} && cd {{release_path}} && npm run build');
});
task('queue:restart', function (): void {
run('cd {{release_path}} && php artisan queue:restart');
});
task('deploy:write_revision_file', function (): void {
run('cd {{release_path}} && echo "{{branch}}" > BRANCH');
run('cd {{release_path}} && date -u +"%Y-%m-%dT%H:%M:%SZ" > DEPLOYED_AT');
});
task('artisan:clear', function (): void {
run('cd {{release_path}} && php artisan view:clear');
run('cd {{release_path}} && php artisan optimize:clear');
run('cd {{release_path}} && php artisan config:clear');
run('cd {{release_path}} && php artisan route:clear');
});
task('services:restart', function (): void {
run('sudo -n nginx -t');
run('sudo -n systemctl reload nginx');
run('sudo -n systemctl restart php8.3-fpm');
});
after('deploy:update_code', 'deploy:write_revision_file');
after('deploy:vendors', 'build');
after('deploy:symlink', 'artisan:clear');
after('deploy:symlink', 'queue:restart');
after('deploy:failed', 'deploy:unlock');
after('deploy:symlink', 'services:restart');