1 | <?php |
||
2 | namespace Deployer; |
||
3 | |||
4 | require_once __DIR__ . '/common.php'; |
||
5 | |||
6 | /** |
||
7 | * Yii 2 Advanced Project Template configuration |
||
8 | */ |
||
9 | |||
10 | // Yii 2 Advanced Project Template shared dirs |
||
11 | set('shared_dirs', [ |
||
12 | 'frontend/runtime', |
||
13 | 'backend/runtime', |
||
14 | 'console/runtime', |
||
15 | ]); |
||
16 | |||
17 | // Yii 2 Advanced Project Template shared files |
||
18 | set('shared_files', [ |
||
19 | 'common/config/main-local.php', |
||
20 | 'common/config/params-local.php', |
||
21 | 'frontend/config/main-local.php', |
||
22 | 'frontend/config/params-local.php', |
||
23 | 'backend/config/main-local.php', |
||
24 | 'backend/config/params-local.php', |
||
25 | 'console/config/main-local.php', |
||
26 | 'console/config/params-local.php', |
||
27 | ]); |
||
28 | |||
29 | /** |
||
30 | * Initialization |
||
31 | */ |
||
32 | task('deploy:init', function () { |
||
33 | run('{{bin/php}} {{release_path}}/init --env=Production --overwrite=n'); |
||
34 | })->desc('Initialization'); |
||
35 | |||
36 | /** |
||
37 | * Run migrations |
||
38 | */ |
||
39 | task('deploy:run_migrations', function () { |
||
40 | run('{{bin/php}} {{release_path}}/yii migrate up --interactive=0'); |
||
41 | })->desc('Run migrations'); |
||
42 | |||
43 | /** |
||
44 | * Main task |
||
45 | */ |
||
46 | task('deploy', [ |
||
47 | 'deploy:info', |
||
48 | 'deploy:setup', |
||
49 | 'deploy:lock', |
||
50 | 'deploy:release', |
||
51 | 'deploy:update_code', |
||
52 | 'deploy:vendors', |
||
53 | 'deploy:init', |
||
54 | 'deploy:shared', |
||
55 | 'deploy:writable', |
||
56 | 'deploy:run_migrations', |
||
57 | 'deploy:symlink', |
||
58 | 'deploy:unlock', |
||
59 | 'deploy:cleanup', |
||
60 | ])->desc('Deploy your project'); |
||
61 | |||
62 | after('deploy', 'success'); |
||
63 |