fix(volume-backups): preserve backup failure status

This commit is contained in:
Aditya Nandlal
2026-08-14 12:51:28 +00:00
parent 2598a62771
commit c6ab76fe09
2 changed files with 44 additions and 1 deletions
@@ -28,11 +28,21 @@ export const createRestartSafeBackupCommand = ({
${backupCommand}
)
DOKPLOY_VOLUME_BACKUP_STATUS=$?
(
set -e
${startCommand}
)
DOKPLOY_VOLUME_RESTART_STATUS=$?
set -e
${startCommand}
if [ "$DOKPLOY_VOLUME_BACKUP_STATUS" -ne 0 ]; then
if [ "$DOKPLOY_VOLUME_RESTART_STATUS" -ne 0 ]; then
echo "Service restart also failed with exit code $DOKPLOY_VOLUME_RESTART_STATUS"
fi
exit "$DOKPLOY_VOLUME_BACKUP_STATUS"
fi
if [ "$DOKPLOY_VOLUME_RESTART_STATUS" -ne 0 ]; then
exit "$DOKPLOY_VOLUME_RESTART_STATUS"
fi
${uploadCommand}
`;