Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployer/symfony/config/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
// Prod deployment, add backup
task('database:backup')->select('prod');
before('deploy:database:update', 'database:backup');
set('sync_database_backup_config', __DIR__ . '/.deployment/db-sync-tool/backup-prod.yaml');
set('sync_database_backup_config', './.deployment/db-sync-tool/backup-prod.yaml');
1 change: 1 addition & 0 deletions deployer/sync/config/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

namespace Deployer;

set('db_sync_tool', 'db_sync_tool'); # set to false, to disable db backup
#set('sync_database_backup_config', null);
7 changes: 6 additions & 1 deletion deployer/sync/task/database_backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@

$optionalVerbose = isVerbose() ? '-v' : '';

if (false === get('db_sync_tool')) {
debug('Skipping database backup, db_sync_tool was disabled');
return;
}

if (commandExistLocally("{{db_sync_tool}}")) {
info('Generating a database backup');
runLocally("{{db_sync_tool}} -f {{sync_database_backup_config}} --use-rsync -y $optionalVerbose");
} else {
debug("Skipping database sync, {{db_sync_tool}} not available");
debug("Skipping database backup, {{db_sync_tool}} not available");
}

})
Expand Down
2 changes: 1 addition & 1 deletion deployer/typo3/task/deploy_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
task('database:backup')->select('prod');
before('deploy:database:update', 'database:backup');
set('sync_database_backup_config', __DIR__ . '/.deployment/db-sync-tool/backup-prod.yaml');
set('sync_database_backup_config', './.deployment/db-sync-tool/backup-prod.yaml');


function getDatabasePasswordForTypo3(): string|bool
Expand Down