Skip to content

Commit 15c488b

Browse files
fix: ensure prod database backup runs and can be disabled
1 parent a3ff89c commit 15c488b

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

deployer/symfony/config/set.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@
8484
// Prod deployment, add backup
8585
task('database:backup')->select('prod');
8686
before('deploy:database:update', 'database:backup');
87-
set('sync_database_backup_config', __DIR__ . '/.deployment/db-sync-tool/backup-prod.yaml');
87+
set('sync_database_backup_config', './.deployment/db-sync-tool/backup-prod.yaml');

deployer/sync/config/set.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
namespace Deployer;
44

5+
set('db_sync_tool', 'db_sync_tool'); # set to false, to disable db backup
56
#set('sync_database_backup_config', null);

deployer/sync/task/database_backup.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66

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

9+
if (false === get('db_sync_tool')) {
10+
debug('Skipping database backup, db_sync_tool was disabled');
11+
return;
12+
}
13+
914
if (commandExistLocally("{{db_sync_tool}}")) {
1015
info('Generating a database backup');
1116
runLocally("{{db_sync_tool}} -f {{sync_database_backup_config}} --use-rsync -y $optionalVerbose");
1217
} else {
13-
debug("Skipping database sync, {{db_sync_tool}} not available");
18+
debug("Skipping database backup, {{db_sync_tool}} not available");
1419
}
1520

1621
})

deployer/typo3/task/deploy_database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
task('database:backup')->select('prod');
1818
before('deploy:database:update', 'database:backup');
19-
set('sync_database_backup_config', __DIR__ . '/.deployment/db-sync-tool/backup-prod.yaml');
19+
set('sync_database_backup_config', './.deployment/db-sync-tool/backup-prod.yaml');
2020

2121

2222
function getDatabasePasswordForTypo3(): string|bool

0 commit comments

Comments
 (0)