rename shop group to oxid
This commit is contained in:
parent
e1de358e91
commit
64de601728
@ -10,8 +10,8 @@ See Deployer OXID recipe project for further instructions.
|
|||||||
|
|
||||||
## available tasks
|
## available tasks
|
||||||
|
|
||||||
- dep `shop:getVersion` [stage] - show version of current OXID installation
|
- dep `oxid:getVersion` [stage] - show version of current OXID installation
|
||||||
- dep `shop:backupDatabase` [stage] - rotate old database backups and create a new one
|
- dep `oxid:backupDatabase` [stage] - rotate old database backups and create a new one
|
||||||
- dep `shop:cloneDatabase` [stage] - dump contents from source to destination database
|
- dep `oxid:cloneDatabase` [stage] - dump contents from source to destination database
|
||||||
- dep `shop:runMigration` [stage] - run all database migrations
|
- dep `oxid:runMigration` [stage] - run all database migrations
|
||||||
- dep `setup:createDbConfig` [stage] - generate database configuration file
|
- dep `setup:createDbConfig` [stage] - generate database configuration file
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
namespace Deployer;
|
namespace Deployer;
|
||||||
|
|
||||||
desc('run all database migrations');
|
desc('run all database migrations');
|
||||||
task('shop:runMigration', [
|
task('oxid:runMigration', [
|
||||||
'shop:setShopsOffline',
|
'oxid:setShopsOffline',
|
||||||
'shop:executeMigrations',
|
'oxid:executeMigrations',
|
||||||
'shop:setShopsOnline'
|
'oxid:setShopsOnline'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
require_once 'inc/database.php';
|
require_once 'inc/database.php';
|
||||||
|
|
||||||
desc('set shops offline');
|
desc('set shops offline');
|
||||||
task('shop:setShopsOffline', function() {
|
task('oxid:setShopsOffline', function() {
|
||||||
if (get('mysql_configured')) {
|
if (get('mysql_configured')) {
|
||||||
$query = "UPDATE oxshops SET oxactive = '0', OXREGISTERSUBJECT = CONCAT('..', OXREGISTERSUBJECT) WHERE oxactive = '1';";
|
$query = "UPDATE oxshops SET oxactive = '0', OXREGISTERSUBJECT = CONCAT('..', OXREGISTERSUBJECT) WHERE oxactive = '1';";
|
||||||
run('{{bin/mysql}} --defaults-extra-file={{db_conf_path}} -e "'.$query.'"');
|
run('{{bin/mysql}} --defaults-extra-file={{db_conf_path}} -e "'.$query.'"');
|
||||||
@ -22,21 +22,21 @@ task('shop:setShopsOffline', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
task('shop:runMigration:failed', function() {
|
task('oxid:runMigration:failed', function() {
|
||||||
invoke('shop:setShopsOnline');
|
invoke('oxid:setShopsOnline');
|
||||||
})->hidden();
|
})->hidden();
|
||||||
|
|
||||||
fail('shop:runMigration', 'shop:runMigration:failed');
|
fail('oxid:runMigration', 'oxid:runMigration:failed');
|
||||||
|
|
||||||
desc('execute OXID Doctrine migrations');
|
desc('execute OXID Doctrine migrations');
|
||||||
task('shop:executeMigrations', function () {
|
task('oxid: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');
|
||||||
}
|
}
|
||||||
})->hidden();;
|
})->hidden();;
|
||||||
|
|
||||||
desc('set shops online');
|
desc('set shops online');
|
||||||
task('shop:setShopsOnline', function() {
|
task('oxid:setShopsOnline', function() {
|
||||||
if (get('mysql_configured')) {
|
if (get('mysql_configured')) {
|
||||||
$query = "UPDATE oxshops SET oxactive = '1', OXREGISTERSUBJECT = SUBSTR(OXREGISTERSUBJECT, 3) WHERE oxactive = '0' AND OXREGISTERSUBJECT LIKE '..%';";
|
$query = "UPDATE oxshops SET oxactive = '1', OXREGISTERSUBJECT = SUBSTR(OXREGISTERSUBJECT, 3) WHERE oxactive = '0' AND OXREGISTERSUBJECT LIKE '..%';";
|
||||||
run('{{bin/mysql}} --defaults-extra-file={{db_conf_path}} -e "'.$query.'"');
|
run('{{bin/mysql}} --defaults-extra-file={{db_conf_path}} -e "'.$query.'"');
|
||||||
@ -46,7 +46,7 @@ task('shop:setShopsOnline', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
desc('show version of current OXID installation');
|
desc('show version of current OXID installation');
|
||||||
task('shop:getVersion', function () {
|
task('oxid:getVersion', function () {
|
||||||
if (test("[ -f {{current_path}}/composer.lock ]")) {
|
if (test("[ -f {{current_path}}/composer.lock ]")) {
|
||||||
cd('{{current_path}}');
|
cd('{{current_path}}');
|
||||||
info(
|
info(
|
||||||
@ -58,7 +58,7 @@ task('shop:getVersion', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
desc('dump contents from source to destination database');
|
desc('dump contents from source to destination database');
|
||||||
task('shop:cloneDatabase', function () {
|
task('oxid:cloneDatabase', function () {
|
||||||
if (get('mysql_configured') && get('mysqldump_configured')) {
|
if (get('mysql_configured') && get('mysqldump_configured')) {
|
||||||
info('Note: Use a dedicated read only user for accessing the source database.');
|
info('Note: Use a dedicated read only user for accessing the source database.');
|
||||||
info('Using the following source database:');
|
info('Using the following source database:');
|
||||||
@ -84,7 +84,7 @@ task('shop:cloneDatabase', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
desc('rotate old database backups and create a new one');
|
desc('rotate old database backups and create a new one');
|
||||||
task('shop:backupDatabase', function () {
|
task('oxid:backupDatabase', function () {
|
||||||
if (get('mysql_configured') && get('mysqldump_configured')) {
|
if (get('mysql_configured') && get('mysqldump_configured')) {
|
||||||
if (!test("[ -f {{deploy_path}}/database/rotatemap.conf ]")) {
|
if (!test("[ -f {{deploy_path}}/database/rotatemap.conf ]")) {
|
||||||
run('printf "{{deploy_path}}/database/backup/backup.sql {\n rotate 5\n}" > {{deploy_path}}/database/rotatemap.conf');
|
run('printf "{{deploy_path}}/database/backup/backup.sql {\n rotate 5\n}" > {{deploy_path}}/database/rotatemap.conf');
|
||||||
|
Loading…
Reference in New Issue
Block a user