mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 08:12:29 +01:00
* Added migrate task to Yii recipe Resolves #3559 * Changed path and PHP executable to be more generic * Added doc entry. * Added --interactive=0 flag so that migrations will run automatically.
29 lines
537 B
PHP
29 lines
537 B
PHP
<?php
|
|
namespace Deployer;
|
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
add('recipes', ['yii']);
|
|
|
|
// Yii shared dirs
|
|
set('shared_dirs', ['runtime']);
|
|
|
|
// Yii writable dirs
|
|
set('writable_dirs', ['runtime']);
|
|
|
|
desc('Runs Yii2 migrations for your project');
|
|
task('deploy:migrate', function () {
|
|
run('cd {{release_or_current_path}} && {{bin/php}} yii migrate --interactive=0');
|
|
});
|
|
|
|
/**
|
|
* Main task
|
|
*/
|
|
desc('Deploys your project');
|
|
task('deploy', [
|
|
'deploy:prepare',
|
|
'deploy:vendors',
|
|
'deploy:migrate',
|
|
'deploy:publish',
|
|
]);
|