2015-09-25 16:05:47 -04:00
|
|
|
<?php
|
2016-01-11 14:00:45 +07:00
|
|
|
namespace Deployer;
|
|
|
|
|
2015-09-25 16:05:47 -04:00
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
|
2020-10-25 16:00:05 +01:00
|
|
|
add('recipes', ['cakephp']);
|
|
|
|
|
2015-09-25 16:05:47 -04:00
|
|
|
/**
|
2020-10-25 16:00:05 +01:00
|
|
|
* CakePHP 4 Project Template configuration
|
2015-09-25 16:05:47 -04:00
|
|
|
*/
|
|
|
|
|
2020-10-25 16:00:05 +01:00
|
|
|
// CakePHP 4 Project Template shared dirs
|
2015-09-25 16:05:47 -04:00
|
|
|
set('shared_dirs', [
|
|
|
|
'logs',
|
|
|
|
'tmp',
|
|
|
|
]);
|
|
|
|
|
2020-10-25 16:00:05 +01:00
|
|
|
// CakePHP 4 Project Template shared files
|
2015-09-25 16:05:47 -04:00
|
|
|
set('shared_files', [
|
2020-10-25 16:00:05 +01:00
|
|
|
'config/.env',
|
2015-09-25 16:05:47 -04:00
|
|
|
'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 () {
|
2021-04-03 13:05:45 +01:00
|
|
|
run('{{release_or_current_path}}/bin/cake plugin assets symlink');
|
2015-09-25 16:05:47 -04:00
|
|
|
})->desc('Initialization');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run migrations
|
|
|
|
*/
|
|
|
|
task('deploy:run_migrations', function () {
|
2021-04-03 13:05:45 +01:00
|
|
|
run('{{release_or_current_path}}/bin/cake migrations migrate');
|
|
|
|
run('{{release_or_current_path}}/bin/cake schema_cache clear');
|
2021-06-09 22:52:53 +02:00
|
|
|
run('{{release_or_current_path}}/bin/cake schema_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', [
|
2020-10-08 01:53:45 +02:00
|
|
|
'deploy:prepare',
|
2015-09-25 16:05:47 -04:00
|
|
|
'deploy:vendors',
|
|
|
|
'deploy:init',
|
|
|
|
'deploy:run_migrations',
|
2020-10-08 01:53:45 +02:00
|
|
|
'deploy:publish',
|
2015-09-25 16:05:47 -04:00
|
|
|
])->desc('Deploy your project');
|