diff --git a/README.md b/README.md index 41a8f61..3f7078f 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,9 @@ This command set `current` directory to previous deployment: ## Available tasks -* dep `deploy` [stage] - create a new release for defined stage -* dep `rollback` [stage] - switch to previous release +- dep `deploy` [stage] - create a new release for defined stage +- dep `rollback` [stage] - switch to previous release +- dep `migrate`[stage] - run all database migrations * dep `duplicateDatabase` [stage] - dump contents from source database (live) to destination database (stage) and replace live to stage URLs * dep `getVersion` [stage] - show version of current WordPress installation diff --git a/deploy.php b/deploy.php index 7d56265..f3a194b 100644 --- a/deploy.php +++ b/deploy.php @@ -16,13 +16,17 @@ after('deploy:vendors', 'deploy:d3OxidTasks'); desc('Oxid related tasks'); task('deploy:d3OxidTasks', [ - 'deploy:clear_paths', - 'deploy:setShopsOffline', - 'deploy:setShopsOnline' + 'deploy:clear_paths' +]); + +desc('run all database migrations'); +task('migrate', [ + 'migrate:setShopsOffline', + 'migrate:setShopsOnline' ]); desc('set shops offline'); -task('deploy:setShopsOffline', function() { +task('migrate:setShopsOffline', function() { if (has('bin/mysql') && strlen(get('bin/mysql')) && has('db_name') && strlen(get('db_name')) && has('db_conf_path') && strlen(get('db_conf_path')) && test("[ -f {{db_conf_path}} ]") @@ -32,10 +36,10 @@ task('deploy:setShopsOffline', function() { } else { info('missing config, task skipped'); } -})->select('role=production,role=stage'); +}); desc('set shops online'); -task('deploy:setShopsOnline', function() { +task('migrate:setShopsOnline', function() { if (has('bin/mysql') && strlen(get('bin/mysql')) && has('db_name') && strlen(get('db_name')) && has('db_conf_path') && strlen(get('db_conf_path')) && test("[ -f {{db_conf_path}} ]") @@ -45,4 +49,5 @@ task('deploy:setShopsOnline', function() { } else { info('missing config, task skipped'); } -})->select('role=production,role=stage'); +}); +