can disable and enable shops

Cette révision appartient à :
Daniel Seifert 2024-10-16 23:22:22 +02:00
Parent bc45dda2e9
révision 8a5322fa77
Signé par: DanielS
ID de la clé GPG: 6A513E13AEE66170
2 fichiers modifiés avec 36 ajouts et 3 suppressions

Voir le fichier

@ -17,5 +17,32 @@ after('deploy:vendors', 'deploy:d3OxidTasks');
desc('Oxid related tasks');
task('deploy:d3OxidTasks', [
'deploy:clear_paths',
'deploy:update_code' // reset committed shop files
'deploy:setShopsOffline',
'deploy:setShopsOnline'
]);
desc('set shops offline');
task('deploy:setShopsOffline', function() {
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
has('dbName') && strlen(get('dbName')) &&
has('dbConfPath') && strlen(get('dbConfPath')) && test("[ -f {{dbConfPath}} ]")
) {
$query = "UPDATE oxshops SET oxactive = '0', OXREGISTERSUBJECT = CONCAT('..', OXREGISTERSUBJECT) WHERE oxactive = '1';";
run('{{bin/mysql}} --defaults-extra-file={{dbConfPath}} {{dbName}} -e "'.$query.'"');
} else {
info('missing config, task skipped');
}
})->select('role=production,role=stage');
desc('set shops online');
task('deploy:setShopsOnline', function() {
if (has('bin/mysql') && strlen(get('bin/mysql')) &&
has('dbName') && strlen(get('dbName')) &&
has('dbConfPath') && strlen(get('dbConfPath')) && test("[ -f {{dbConfPath}} ]")
) {
$query = "UPDATE oxshops SET oxactive = '1', OXREGISTERSUBJECT = SUBSTR(OXREGISTERSUBJECT, 3) WHERE oxactive = '0' AND OXREGISTERSUBJECT LIKE '..%';";
run('{{bin/mysql}} --defaults-extra-file={{dbConfPath}} {{dbName}} -e "'.$query.'"');
} else {
info('missing config, task skipped');
}
})->select('role=production,role=stage');

Voir le fichier

@ -3,10 +3,12 @@ config:
keep_releases: 5
repository: gitfhfac@git.d3data.de:Customers/my.shop.com.git
bin/php: /usr/local/php8.2/bin/php
bin/mysql: /usr/local/mysql/bin/mysql
.base: &base
local: true
deploy_path: /home/XXX/{{application}}_{{alias}}
dbConfPath: /home/phfhcwoc/dbConf/my_{{alias}}.cnf
shared_files:
- .htpasswd
- .env # otherwise source/config.inc.php
@ -24,12 +26,16 @@ config:
hosts:
production:
<<: *base
roles: production
branch: rel_7.0.x
dbName: myProdDatabase
labels:
role: production # production | stage | development
development:
<<: *base
roles: development
branch: dev_7.1.x
dbName: myDevDatabase
keep_releases: 1
composer_options: --verbose --prefer-dist --no-progress --no-interaction # without no-dev option
labels:
role: development