add shop version task, group shop dependent tasks into shop group
This commit is contained in:
parent
ca042a3a3f
commit
2bc766d242
@ -43,10 +43,10 @@ This command set `current` directory to previous deployment:
|
|||||||
|
|
||||||
## Available tasks
|
## 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 `setup:createDbConfig` [stage] - generate database configuration file
|
||||||
- dep `list`- list all available commands
|
- dep `list`- list all available commands
|
||||||
|
|
||||||
### work in progress
|
### work in progress
|
||||||
- dep `duplicateDatabase` [stage] - dump contents from source database (live) to destination database (stage) and replace live to stage URLs
|
- 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
|
|
||||||
|
32
deploy.php
32
deploy.php
@ -20,14 +20,14 @@ task('deploy:d3OxidTasks', [
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
desc('run all database migrations');
|
desc('run all database migrations');
|
||||||
task('migrate', [
|
task('shop:migrate', [
|
||||||
'migrate:setShopsOffline',
|
'shop:setShopsOffline',
|
||||||
'migrate:executeMigrations',
|
'shop:executeMigrations',
|
||||||
'migrate:setShopsOnline'
|
'shop:setShopsOnline'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
desc('set shops offline');
|
desc('set shops offline');
|
||||||
task('migrate:setShopsOffline', function() {
|
task('shop:setShopsOffline', function() {
|
||||||
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
|
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
|
||||||
has('db_name') && strlen(get('db_name')) &&
|
has('db_name') && strlen(get('db_name')) &&
|
||||||
has('db_conf_path') && strlen(get('db_conf_path')) && test("[ -f {{db_conf_path}} ]")
|
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() {
|
task('shop:migrate:failed', function() {
|
||||||
invoke('migrate:setShopsOnline');
|
invoke('shop:setShopsOnline');
|
||||||
})->hidden();
|
})->hidden();
|
||||||
|
|
||||||
fail('migrate', 'migrate:failed');
|
fail('shop:migrate', 'shop:migrate:failed');
|
||||||
|
|
||||||
desc('execute OXID Doctrine migrations');
|
desc('execute OXID Doctrine migrations');
|
||||||
task('migrate:executeMigrations', function () {
|
task('shop:executeMigrations', function () {
|
||||||
if (test("[ -f {{current_path}}/vendor/bin/oe-eshop-doctrine_migration ]")) {
|
if (test("[ -f {{current_path}}/vendor/bin/oe-eshop-doctrine_migration ]")) {
|
||||||
run('{{bin/php}} {{current_path}}/vendor/bin/oe-eshop-doctrine_migration migrations:migrate');
|
run('{{bin/php}} {{current_path}}/vendor/bin/oe-eshop-doctrine_migration migrations:migrate');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
desc('set shops online');
|
desc('set shops online');
|
||||||
task('migrate:setShopsOnline', function() {
|
task('shop:setShopsOnline', function() {
|
||||||
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
|
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
|
||||||
has('db_name') && strlen(get('db_name')) &&
|
has('db_name') && strlen(get('db_name')) &&
|
||||||
has('db_conf_path') && strlen(get('db_conf_path')) && test("[ -f {{db_conf_path}} ]")
|
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());
|
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'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user