deployer/recipe/cakephp.php

59 lines
1.2 KiB
PHP
Raw Normal View History

2015-09-25 16:05:47 -04:00
<?php
/* (c) Jad Bitar <jadb@cakephp.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2016-01-11 14:00:45 +07:00
namespace Deployer;
2015-09-25 16:05:47 -04:00
require_once __DIR__ . '/common.php';
/**
* CakePHP 3 Project Template configuration
*/
2015-09-25 22:33:30 -04:00
// CakePHP 3 Project Template shared dirs
2015-09-25 16:05:47 -04:00
set('shared_dirs', [
'logs',
'tmp',
]);
2015-09-25 22:33:30 -04:00
// CakePHP 3 Project Template shared files
2015-09-25 16:05:47 -04:00
set('shared_files', [
'config/app.php',
]);
/**
* Create plugins' symlinks
2015-09-25 16:05:47 -04:00
*/
task('deploy:init', function () {
run('{{release_path}}/bin/cake plugin assets symlink');
2015-09-25 16:05:47 -04:00
})->desc('Initialization');
/**
* Run migrations
*/
task('deploy:run_migrations', function () {
run('{{release_path}}/bin/cake migrations migrate');
run('{{release_path}}/bin/cake orm_cache clear');
run('{{release_path}}/bin/cake orm_cache build');
2015-09-25 16:05:47 -04:00
})->desc('Run migrations');
/**
* Main task
*/
task('deploy', [
2015-09-25 16:05:47 -04:00
'deploy:prepare',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:init',
'deploy:run_migrations',
'deploy:symlink',
'cleanup',
])->desc('Deploy your project');
after('deploy', 'success');