gallery-api/deploy.php

54 lines
1.2 KiB
PHP
Raw Normal View History

2017-07-21 19:59:16 +02:00
<?php
2017-07-21 20:26:13 +02:00
namespace Deployer;
2017-07-21 19:59:16 +02:00
require 'recipe/common.php';
2017-07-21 20:26:13 +02:00
set('ssh_type', 'native');
set('ssh_multiplexing', true);
2017-07-21 19:59:16 +02:00
2017-08-09 15:47:05 +02:00
set('repository', 'https://gogs.ragnarok.yvan.hu/yvan/gallery-api.git');
2017-07-21 20:26:13 +02:00
set('shared_dirs', [
2017-08-15 00:32:07 +02:00
'data/export',
2017-07-21 19:59:16 +02:00
'data/galleries',
2017-08-15 00:32:07 +02:00
'data/tmp',
2017-07-21 19:59:16 +02:00
]);
2017-08-14 13:17:30 +02:00
set('shared_files', [
'config/autoload/doctrine.local.php',
'data/gallery.db',
]);
2017-07-21 20:26:13 +02:00
set('writable_dirs', []);
set('keep_releases', 3);
set('default_stage', 'production');
2017-07-21 19:59:16 +02:00
host('alfheim.ragnarok.yvan.hu', 22)
2017-07-21 20:26:13 +02:00
->stage('production')
->user('yvan')
->forwardAgent()
->set('php_service_name', 'php7.1-fpm')
2017-08-09 15:47:05 +02:00
->set('deploy_path', '/mnt/apps/photos/api');
2017-07-21 20:26:13 +02:00
desc('Restart PHP-FPM service');
task('php-fpm:restart', 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');
2017-07-21 19:59:16 +02:00
});
2017-08-09 15:47:05 +02:00
after('deploy:symlink', 'php-fpm:restart');
2017-07-21 19:59:16 +02:00
task('deploy', [
'deploy:prepare',
2017-07-21 20:26:13 +02:00
'deploy:lock',
2017-07-21 19:59:16 +02:00
'deploy:release',
'deploy:update_code',
'deploy:shared',
2017-07-21 20:26:13 +02:00
'deploy:writable',
'deploy:vendors',
'deploy:clear_paths',
2017-07-21 19:59:16 +02:00
'deploy:symlink',
2017-07-21 20:26:13 +02:00
'deploy:unlock',
2017-07-21 19:59:16 +02:00
'cleanup',
]);
2017-07-21 20:26:13 +02:00
after('deploy', 'success');