Files
Nexus/deploy/update.sh
T
Nexus Deploy 0a7c5ee617 fix(deploy): set executable bit on nx and refresh symlinks on update
Git tracked deploy/nx as 644 so /usr/local/bin/nx failed with Permission denied after pull; update.sh now chmods CLI scripts before upgrade.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 04:39:33 +08:00

29 lines
912 B
Bash
Executable File

#!/usr/bin/env bash
# Nexus 6.0 — 一键更新(拉代码 + 重建镜像 + 重启)
#
# 已在 /opt/nexus:
# bash deploy/update.sh
# bash deploy/update.sh --no-cache # 强制无缓存重建(entrypoint/Dockerfile 变更后)
#
# 远程一条命令:
# curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/update.sh" | bash
#
set -euo pipefail
ROOT="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." && pwd)"
ensure_cli_executable() {
chmod +x \
"$ROOT/deploy/nx" \
"$ROOT/deploy/update.sh" \
"$ROOT/deploy/nexus-1panel.sh" \
"$ROOT/deploy/install-nexus-fresh.sh" \
2>/dev/null || true
if [[ "$(id -u)" -eq 0 ]]; then
ln -sf "$ROOT/deploy/nx" /usr/local/bin/nx
ln -sf "$ROOT/deploy/update.sh" /usr/local/bin/nexus-update
fi
}
ensure_cli_executable
exec bash "$ROOT/deploy/nexus-1panel.sh" upgrade "$@"