mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
/* (c) Anton Medvedev <anton@medv.io>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Deployer;
|
|
|
|
require_once 'recipe/common.php';
|
|
|
|
set('shared_dirs', ['var/log', 'var/sessions']);
|
|
set('shared_files', ['.env']);
|
|
set('writable_dirs', ['var']);
|
|
|
|
set('bin/console', function () {
|
|
return parse('{{bin/php}} {{release_path}}/bin/console --no-interaction');
|
|
});
|
|
|
|
desc('Migrate database');
|
|
task('database:migrate', function () {
|
|
run('{{bin/console}} doctrine:migrations:migrate --allow-no-migration');
|
|
});
|
|
|
|
desc('Clear cache');
|
|
task('deploy:cache:clear', function () {
|
|
run('{{bin/console}} cache:clear --no-warmup');
|
|
});
|
|
|
|
desc('Warm up cache');
|
|
task('deploy:cache:warmup', function () {
|
|
run('{{bin/console}} cache:warmup');
|
|
});
|
|
|
|
desc('Deploy project');
|
|
task('deploy', [
|
|
'deploy:info',
|
|
'deploy:prepare',
|
|
'deploy:lock',
|
|
'deploy:release',
|
|
'deploy:update_code',
|
|
'deploy:shared',
|
|
'deploy:writable',
|
|
'deploy:vendors',
|
|
'deploy:cache:clear',
|
|
'deploy:cache:warmup',
|
|
'deploy:symlink',
|
|
'deploy:unlock',
|
|
'cleanup',
|
|
]);
|
|
|
|
after('deploy', 'success');
|