8
0

add shop version task, group shop dependent tasks into shop group

Dieser Commit ist enthalten in:
Daniel Seifert 2024-10-25 09:47:07 +02:00
Ursprung ca042a3a3f
Commit 2bc766d242
2 geänderte Dateien mit 25 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -43,10 +43,10 @@ This command set `current` directory to previous deployment:
## Available tasks
- dep `migrate`[stage] - run all database migrations
- dep `shop:version` [stage] - show version of current OXID installation
- dep `shop:migrate` [stage] - run all database migrations
- dep `setup:createDbConfig` [stage] - generate database configuration file
- dep `list`- list all available commands
### work in progress
- 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
- dep `duplicateDatabase` [stage] - dump contents from source database (live) to destination database (stage) and replace live to stage URLs

Datei anzeigen

@ -20,14 +20,14 @@ task('deploy:d3OxidTasks', [
]);
desc('run all database migrations');
task('migrate', [
'migrate:setShopsOffline',
'migrate:executeMigrations',
'migrate:setShopsOnline'
task('shop:migrate', [
'shop:setShopsOffline',
'shop:executeMigrations',
'shop:setShopsOnline'
]);
desc('set shops offline');
task('migrate:setShopsOffline', function() {
task('shop: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}} ]")
@ -39,21 +39,21 @@ task('migrate:setShopsOffline', function() {
}
});
task('migrate:failed', function() {
invoke('migrate:setShopsOnline');
task('shop:migrate:failed', function() {
invoke('shop:setShopsOnline');
})->hidden();
fail('migrate', 'migrate:failed');
fail('shop:migrate', 'shop:migrate:failed');
desc('execute OXID Doctrine migrations');
task('migrate:executeMigrations', function () {
task('shop:executeMigrations', function () {
if (test("[ -f {{current_path}}/vendor/bin/oe-eshop-doctrine_migration ]")) {
run('{{bin/php}} {{current_path}}/vendor/bin/oe-eshop-doctrine_migration migrations:migrate');
}
});
desc('set shops online');
task('migrate:setShopsOnline', function() {
task('shop: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}} ]")
@ -91,3 +91,15 @@ task('setup:createDbConfig', function () {
warning($e->getMessage());
}
});
desc('show OXID shop version');
task('shop:version', function () {
if (test("[ -f {{current_path}}/composer.lock ]")) {
cd('{{current_path}}');
info(
run(
'{{bin/composer}} show oxid-esales/oxideshop-ce | grep -ws "versions" | cut -d " " -f 4'
)
);
}
});