feat: add bds core, locale updates and safety fixes

This commit is contained in:
2026-05-31 14:01:34 +03:00
parent d1686355e8
commit c769140913
34 changed files with 1535 additions and 12 deletions

30
lib/rollback.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
ROLLBACK_IN_PROGRESS="no"
rollback_on_error() {
local exit_code="${1:-1}"
local command_failed="${2:-unknown}"
if [[ "$ROLLBACK_IN_PROGRESS" == "yes" ]]; then
return
fi
ROLLBACK_IN_PROGRESS="yes"
local fail_message
fail_message="$(t deployment_failed "$exit_code" "$command_failed")"
error "$fail_message"
send_report "failed" "$fail_message"
warn "$(t rollback_starts "$SERVER_DIR")"
if [[ "${SERVICE_CREATED:-no}" == "yes" ]]; then
remove_service_if_exists
fi
if [[ -n "${LOG_FILE:-}" ]]; then
info "$(t see_log "$LOG_FILE")"
fi
exit "$exit_code"
}