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',
|
|
|
|
]);
|
|
|
|
|
|
|
|
/**
|
2015-10-01 06:06:21 -04:00
|
|
|
* Create plugins' symlinks
|
2015-09-25 16:05:47 -04:00
|
|
|
*/
|
|
|
|
task('deploy:init', function () {
|
2015-10-01 06:06:21 -04:00
|
|
|
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');
|
2015-10-01 06:06:21 -04:00
|
|
|
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
|
|
|
|
*/
|
2016-04-04 17:01:55 +07:00
|
|
|
task('deploy', [
|
2015-09-25 16:05:47 -04:00
|
|
|
'deploy:prepare',
|
2016-11-05 12:56:53 +07:00
|
|
|
'deploy:lock',
|
2015-09-25 16:05:47 -04:00
|
|
|
'deploy:release',
|
|
|
|
'deploy:update_code',
|
|
|
|
'deploy:shared',
|
|
|
|
'deploy:vendors',
|
|
|
|
'deploy:init',
|
|
|
|
'deploy:run_migrations',
|
|
|
|
'deploy:symlink',
|
2016-11-05 12:56:53 +07:00
|
|
|
'deploy:unlock',
|
2015-09-25 16:05:47 -04:00
|
|
|
'cleanup',
|
|
|
|
])->desc('Deploy your project');
|
|
|
|
|
|
|
|
after('deploy', 'success');
|