56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Deployer;
|
|
require 'recipe/common.php';
|
|
|
|
// Configuration
|
|
|
|
set('shared_files', []);
|
|
set('shared_dirs', []);
|
|
set('writable_dirs', []);
|
|
set('keep_releases', 3);
|
|
set('default_stage', 'production');
|
|
|
|
// Servers
|
|
|
|
host('bggeneral.hu')
|
|
->stage('production')
|
|
->user('benkeg_gulbaba_frontend_access')
|
|
->forwardAgent()
|
|
->set('ng_target', 'production')
|
|
->set('ng_environment', 'gulbaba')
|
|
->set('deploy_path', '/var/www/clients/client4/web37/deploy');
|
|
|
|
// Tasks
|
|
|
|
desc('Prepare release');
|
|
task('deploy:ng-prepare', function() {
|
|
runLocally("ng build frontend --prod --output-path=dist-{{ng_environment}}");
|
|
runLocally("tar -C dist-{{ng_environment}} -cJf dist-{{ng_environment}}.tar.xz .");
|
|
});
|
|
|
|
desc('Upload release');
|
|
task('deploy:ng-upload', function() {
|
|
upload("dist-{{ng_environment}}.tar.xz", "{{release_path}}/dist.tar.xz");
|
|
run("tar -C {{release_path}} -xJf {{release_path}}/dist.tar.xz");
|
|
run("rm -f {{release_path}}/dist.tar.xz");
|
|
runLocally("rm -f dist-{{ng_environment}}.tar.xz");
|
|
upload("conf/.htaccess", "{{release_path}}/.htaccess");
|
|
});
|
|
|
|
desc('Deploy your project');
|
|
task('deploy', [
|
|
'deploy:prepare',
|
|
'deploy:lock',
|
|
'deploy:release',
|
|
'deploy:ng-prepare',
|
|
'deploy:ng-upload',
|
|
'deploy:shared',
|
|
'deploy:clear_paths',
|
|
'deploy:symlink',
|
|
'deploy:unlock',
|
|
'cleanup',
|
|
]);
|
|
|
|
after('deploy', 'success');
|