Kufrik/deploy.php

52 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Deployer;
require 'recipe/composer.php';
set('application', 'kufrik');
// HTTPS — Gitea SSH na portu 22 neběží (systémový SSH je 52222)
set('repository', 'https://git.kmetix.cz/kowalski/Kufrik.git');
set('keep_releases', 5);
set('git_tty', false);
set('public_path', 'www');
set('shared_dirs', [
'log',
'data/sdf',
]);
set('shared_files', [
'config/local.neon',
]);
set('writable_dirs', [
'log',
'temp',
'data/sdf',
]);
// sticky = www-data group + g+rwxs (plain chmod 0755 nestačí pro Apache)
set('writable_mode', 'sticky');
set('http_user', 'www-data');
set('http_group', 'www-data');
set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader');
host('production')
->setHostname('kmetix.cz')
->setPort(52222)
->setRemoteUser('deploy')
->setSshMultiplexing(false) // Windows + ControlMaster = getsockname failed
->set('deploy_path', '/var/www/html/kufrik')
->set('branch', 'master');
desc('Vyčistí Nette temp cache v aktuální release');
task('deploy:clear_cache', function () {
run('rm -rf {{release_path}}/temp/cache/*');
});
after('deploy:symlink', 'deploy:clear_cache');
after('deploy:failed', 'deploy:unlock');