1 | <?php |
||
2 | |||
3 | namespace Deployer; |
||
4 | |||
5 | require_once __DIR__ . '/common.php'; |
||
6 | |||
7 | add('recipes', ['cakephp']); |
||
8 | |||
9 | /** |
||
10 | * CakePHP 4 Project Template configuration |
||
11 | */ |
||
12 | |||
13 | // CakePHP 4 Project Template shared dirs |
||
14 | set('shared_dirs', [ |
||
15 | 'logs', |
||
16 | 'tmp', |
||
17 | ]); |
||
18 | |||
19 | // CakePHP 4 Project Template shared files |
||
20 | set('shared_files', [ |
||
21 | 'config/.env', |
||
22 | 'config/app.php', |
||
23 | ]); |
||
24 | |||
25 | /** |
||
26 | * Create plugins' symlinks |
||
27 | */ |
||
28 | task('deploy:init', function () { |
||
29 | run('{{bin/php}} {{release_or_current_path}}/bin/cake.php plugin assets symlink'); |
||
30 | })->desc('Initialization'); |
||
31 | |||
32 | /** |
||
33 | * Run migrations |
||
34 | */ |
||
35 | task('deploy:run_migrations', function () { |
||
36 | run('{{bin/php}} {{release_or_current_path}}/bin/cake.php migrations migrate --no-lock'); |
||
37 | run('{{bin/php}} {{release_or_current_path}}/bin/cake.php schema_cache build'); |
||
38 | })->desc('Run migrations'); |
||
39 | |||
40 | /** |
||
41 | * Main task |
||
42 | */ |
||
43 | task('deploy', [ |
||
44 | 'deploy:prepare', |
||
45 | 'deploy:vendors', |
||
46 | 'deploy:init', |
||
47 | 'deploy:run_migrations', |
||
48 | 'deploy:publish', |
||
49 | ])->desc('Deploy your project'); |
||
50 |