deployer/recipe/cakephp.php

50 lines
1009 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 () {
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 () {
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
*/
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');