deployer/recipe/cakephp.php

49 lines
999 B
PHP
Raw Normal View History

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',
]);
/**
* Create plugins' symlinks
2015-09-25 16:05:47 -04:00
*/
task('deploy:init', function () {
2022-01-07 22:01:22 +00:00
run('{{bin/php}} {{release_or_current_path}}/bin/cake.php plugin assets symlink');
2015-09-25 16:05:47 -04:00
})->desc('Initialization');
/**
* Run migrations
*/
task('deploy:run_migrations', function () {
2022-01-07 22:01:22 +00:00
run('{{bin/php}} {{release_or_current_path}}/bin/cake.php migrations migrate --no-lock');
run('{{bin/php}} {{release_or_current_path}}/bin/cake.php schema_cache build');
2015-09-25 16:05:47 -04:00
})->desc('Run migrations');
/**
* Main task
*/
task('deploy', [
'deploy:prepare',
2015-09-25 16:05:47 -04:00
'deploy:vendors',
'deploy:init',
'deploy:run_migrations',
'deploy:publish',
2015-09-25 16:05:47 -04:00
])->desc('Deploy your project');