80 lines
1.8 KiB
PHP
80 lines
1.8 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', [
|
|
'data/cache',
|
|
'data/logs',
|
|
]);
|
|
set('keep_releases', 3);
|
|
set('default_stage', 'production');
|
|
|
|
|
|
// Servers - mtas : esekivws5222a.rnd.ki.sw.ericsson.se
|
|
host('mtas')
|
|
->stage('production')
|
|
->user('edvidan')
|
|
->forwardAgent()
|
|
->set('deploy_path', '/proj/webdocs/mtoolbox/root/mtastv-inst/backend');
|
|
|
|
|
|
task('build', function() {
|
|
run('composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader');
|
|
run('composer archive --file=release-pkg');
|
|
run('tar -czf vendor-pkg.tar.gz vendor');
|
|
})->local();
|
|
|
|
task('upload', function() {
|
|
upload('release-pkg.tar', '{{release_path}}');
|
|
upload('vendor-pkg.tar.gz', '{{release_path}}');
|
|
cd('{{release_path}}');
|
|
run('tar -xf release-pkg.tar');
|
|
run('tar -xzf vendor-pkg.tar.gz');
|
|
});
|
|
|
|
task('clean-uploaded', function() {
|
|
cd('{{release_path}}');
|
|
run('rm -f release-pkg.tar vendor-pkg.tar.gz');
|
|
});
|
|
|
|
task('restore-dev', function() {
|
|
run('composer install --verbose --no-progress --no-interaction');
|
|
})->local();
|
|
|
|
task('release', [
|
|
'deploy:lock',
|
|
'deploy:prepare',
|
|
'deploy:release',
|
|
'upload',
|
|
'clean-uploaded',
|
|
'deploy:shared',
|
|
'deploy:writable',
|
|
'deploy:symlink',
|
|
'deploy:unlock',
|
|
]);
|
|
|
|
desc('Deploy your project');
|
|
task('deploy', [
|
|
'build',
|
|
'release',
|
|
'cleanup',
|
|
'restore-dev',
|
|
'success',
|
|
]);
|