Files

100 lines
2.2 KiB
PHP

<?php
namespace Deployer;
require 'contrib/cachetool.php';
require 'contrib/rsync.php';
require 'recipe/symfony.php';
add('shared_dirs', [
'var/log',
'var/sessions',
]);
add('shared_files', [
'public/.htaccess',
]);
set('keep_releases', 3);
// Rsync options, mainly files/dirs to exclude
$rsyncOptions = [
'exclude' => [
'.claude',
'.cursor',
'.idea',
'.vscode',
'.DS_Store',
'.ddev',
'.git',
'.github',
'.jj',
'node_modules',
'.editorconfig',
'.env.dev.local',
'.env.dev.local.php',
'.env.test',
'.env.test.local',
'.gitignore',
'.nvmrc',
'.php-cs-fixer.cache',
'.php-cs-fixer.dist.php',
'.phpunit.result.cache',
'CLAUDE.md',
'cypress*',
'deploy.php',
'docs',
'package.json',
'package-lock.json',
'*.http',
'http-client*.json',
'postcss.config.js',
'phpunit.xml.dist',
'public/.htaccess',
'tailwind.config.js',
'webpack.config.js',
'bin/.phpunit',
'temp/',
'tests/',
'uploads/',
'var/',
],
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'rz',
'options' => ['delete', 'copy-links', 'chmod=D755,F664'],
'timeout' => 300,
];
host('prod')
->setHostname('dedi10193.your-server.de')
->setRemoteUser('epbffsf')
->setForwardAgent(true)
->setSshMultiplexing(true)
->setDeployPath('/usr/home/epbffsf/public_html/prod')
->set('bin/php', '/usr/bin/php')
->set('http_user', 'epbffsf')
->set('rsync_src', __DIR__)
->set('rsync', $rsyncOptions)
->set('cachetool_args', '--web=SymfonyHttpClient --web-path={{current_path}}/public/ --web-url=https://bff.ep-reisen.net')
;
task('deploy', [
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:cache:clear',
'cachetool:clear:opcache',
'deploy:publish',
]);
after('deploy:failed', 'deploy:unlock');