mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
namespace Deployer;
|
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
/**
|
|
* Yii 2 Advanced Project Template configuration
|
|
*/
|
|
|
|
// Yii 2 Advanced Project Template shared dirs
|
|
set('shared_dirs', [
|
|
'frontend/runtime',
|
|
'backend/runtime',
|
|
'console/runtime',
|
|
]);
|
|
|
|
// Yii 2 Advanced Project Template shared files
|
|
set('shared_files', [
|
|
'common/config/main-local.php',
|
|
'common/config/params-local.php',
|
|
'frontend/config/main-local.php',
|
|
'frontend/config/params-local.php',
|
|
'backend/config/main-local.php',
|
|
'backend/config/params-local.php',
|
|
'console/config/main-local.php',
|
|
'console/config/params-local.php',
|
|
]);
|
|
|
|
/**
|
|
* Initialization
|
|
*/
|
|
task('deploy:init', function () {
|
|
run('{{bin/php}} {{release_path}}/init --env=Production --overwrite=n');
|
|
})->desc('Initialization');
|
|
|
|
/**
|
|
* Run migrations
|
|
*/
|
|
task('deploy:run_migrations', function () {
|
|
run('{{bin/php}} {{release_path}}/yii migrate up --interactive=0');
|
|
})->desc('Run migrations');
|
|
|
|
/**
|
|
* Main task
|
|
*/
|
|
task('deploy', [
|
|
'deploy:prepare',
|
|
'deploy:vendors',
|
|
'deploy:init',
|
|
'deploy:run_migrations',
|
|
'deploy:publish',
|
|
])->desc('Deploy your project');
|
|
|
|
after('deploy', 'success');
|