extract migrate task

Dieser Commit ist enthalten in:
Daniel Seifert 2024-10-17 08:54:34 +02:00
Ursprung 27f664ac51
Commit eb855ef6c3
2 geänderte Dateien mit 15 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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');
});