63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?php
|
|
namespace Deployer;
|
|
require 'recipe/common.php';
|
|
|
|
set('ssh_type', 'native');
|
|
set('ssh_multiplexing', true);
|
|
|
|
// Configuration
|
|
|
|
set('repository', 'ssh://gogs@gogs.ragnarok.yvan.hu:2206/Laterex/webnaplo-gulbaba-api.git');
|
|
set('shared_files', [
|
|
'config/autoload/local.php',
|
|
'config/autoload/doctrine.local.php',
|
|
'config/autoload/mail.local.php',
|
|
]);
|
|
set('shared_dirs', [
|
|
'data/attachments',
|
|
'data/log',
|
|
'data/tmp',
|
|
'data/user-upload',
|
|
]);
|
|
set('writable_dirs', []);
|
|
set('keep_releases', 3);
|
|
set('default_stage', 'production');
|
|
|
|
// Servers
|
|
|
|
host('bggeneral.hu')
|
|
->stage('production')
|
|
->user('benkeg_gulbaba_api_access')
|
|
->forwardAgent()
|
|
->set('bin/php', '/usr/bin/php7.1')
|
|
->set('bin/composer', '{{bin/php}} /var/www/clients/client4/web38/bin/composer')
|
|
->set('php_service_name', 'php7.1-fpm')
|
|
->set('deploy_path', '/var/www/clients/client4/web38/deploy');
|
|
|
|
// Tasks
|
|
|
|
desc('Restart PHP-FPM service');
|
|
task('php-fpm:reload', function () {
|
|
// The user must have rights for restart service
|
|
// /etc/sudoers: $username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
|
|
run('sudo service {{php_service_name}} reload');
|
|
});
|
|
after('deploy:symlink', 'php-fpm:reload');
|
|
|
|
desc('Deploy your project');
|
|
task('deploy', [
|
|
'deploy:prepare',
|
|
'deploy:lock',
|
|
'deploy:release',
|
|
'deploy:update_code',
|
|
'deploy:shared',
|
|
'deploy:writable',
|
|
'deploy:vendors',
|
|
'deploy:clear_paths',
|
|
'deploy:symlink',
|
|
'deploy:unlock',
|
|
'cleanup',
|
|
]);
|
|
|
|
after('deploy', 'success');
|