You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.3 KiB
59 lines
1.3 KiB
<?php |
|
|
|
namespace Deployer; |
|
|
|
require 'recipe/common.php'; |
|
|
|
set('application', 'medvid.cc'); |
|
set('repository', 'gitea@git.medvid.cc:DenysMedvid/new.mdenis.org.git'); |
|
set('git_tty', false); |
|
set('keep_releases', 2); |
|
set('shared_files', []); |
|
set('shared_dirs', []); |
|
set('clear_paths', [ |
|
'Docker', |
|
'.git', |
|
'.gitignore', |
|
'deploy.php', |
|
'.drone.yml', |
|
]); |
|
set('writable_dirs', []); |
|
set('allow_anonymous_stats', false); |
|
set('use_atomic_symlink', true); |
|
|
|
host('medvid.cc') |
|
->user('dmedved') |
|
->set('deploy_path', '/var/www/{{application}}'); |
|
|
|
desc('Deploy your project'); |
|
|
|
task('deploy', [ |
|
'deploy:info', |
|
'deploy:prepare', |
|
'deploy:lock', |
|
'deploy:release', |
|
'deploy:add_keys', |
|
'deploy:update_code', |
|
'deploy:shared', |
|
'deploy:writable', |
|
// 'deploy:vendors', |
|
'deploy:clear_paths', |
|
'deploy:ownership', |
|
'deploy:symlink', |
|
'deploy:unlock', |
|
'cleanup', |
|
'success', |
|
]); |
|
|
|
task('deploy:add_keys', function () { |
|
run('ssh-add ~/.ssh/medvid_cc'); |
|
}); |
|
|
|
task('deploy:ownership', function () { |
|
run('chown dmedved:nginx -h /var/www/{{application}}/current'); |
|
run('chown dmedved:nginx -R /var/www/{{application}}/shared'); |
|
run('chown dmedved:nginx -R /var/www/{{application}}/releases'); |
|
}); |
|
|
|
// [Optional] If deploy fails automatically unlock. |
|
after('deploy:failed', 'deploy:unlock');
|
|
|