Files
myep/deploy.php
T

118 lines
2.9 KiB
PHP

<?php
namespace Deployer;
require 'contrib/cachetool.php';
require 'contrib/rsync.php';
require 'recipe/symfony.php';
add('shared_dirs', [
'config/secret',
'var/bpn',
'var/log',
'var/sessions',
'var/xmlexport',
]);
add('shared_files', [
'public/.htaccess',
'.env.local.php',
'var/data.db',
]);
// Rsync options, mainly files/dirs to exclude
$rsyncOptions = [
'exclude' => [
'.idea',
'.vscode',
'.DS_Store',
'.ddev',
'.git',
'.github',
'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',
'config/secret/',
'deploy.php',
'package.json',
'package-lock.json',
'*.http',
'http-client.private.env.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('92.205.212.39')
->setRemoteUser('ssh-53857-root')
->setForwardAgent(true)
->setSshMultiplexing(true)
->setDeployPath('/kunden/tiefschnee.de/myep-next')
->set('writable_mode', 'chmod')
->set('http_user', 'ssh-53857-root')
->set('bin/php', '/usr/bin/php82')
->set('rsync_src', __DIR__)
->set('rsync', $rsyncOptions)
->set('cachetool_args', '--web=SymfonyHttpClient --web-path={{release_or_current_path}}/public/ --web-url=https://myep.ep-reisen.de')
;
host('staging')
->setHostname('185.243.132.170')
->setRemoteUser('p546473')
->setForwardAgent(true)
->setSshMultiplexing(true)
->setDeployPath('/home/www/p546473/html/myep')
->set('writable_mode', 'chmod')
->set('bin/php', '/usr/local/bin/php')
->set('rsync_src', __DIR__)
->set('rsync', $rsyncOptions)
->set('keep_releases', 5)
->set('cachetool_args', '--web=SymfonyHttpClient --web-path={{release_or_current_path}}/public/ --web-url=https://myep.dreipunktnull.net')
;
task('deploy', [
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'database:migrate',
'deploy:publish',
'cachetool:clear:opcache',
'deploy:stop-workers',
]);
task('deploy:stop-workers', function () {
run('{{bin/console}} messenger:stop-workers');
});
after('deploy:failed', 'deploy:unlock');