mtas-tv-backend/deploy.php
Dávid Danyi 68090e9cb2 * logger middleware added
* production.db added to shared files
* missing dependencies added to composer
2018-04-20 15:17:29 +02:00

60 lines
1.4 KiB
PHP

<?php
namespace Deployer;
require 'recipe/common.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', 'https://gogs.ragnarok.yvan.hu/MTAS/mtas-tv-backend.git');
set('shared_files', [
'config/autoload/local.php',
'config/autoload/los-basepath.local.php',
'config/autoload/doctrine.local.php',
'data/production.db',
]);
/*
set('shared_dirs', [
'data/persistent',
]);
*/
set('writable_dirs', []);
set('keep_releases', 3);
set('default_stage', 'production');
// Servers
host('vasgyuro.tsp')
->stage('production')
->user('edvidan')
->forwardAgent()
->set('php_service_name', 'php7.1-fpm')
->set('deploy_path', '/home/edvidan/applications/mtastv-api');
desc('Reload 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');
}); //->onlyOn('alfheim');
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');