deployer/recipe/yii.php
Ferenc Papp 68deaa7aaf
Added migrate task to Yii recipe (#3563)
* 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.
2023-04-12 13:52:58 +02:00

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',
]);