5a56e5a8cb
- /state 白名单脱敏;init-db db_port 修复;connection-check 后清空 redis_pass - install.html sessionStorage token 与无 token 友好提示 - nx update: 镜像 import 门控、健康失败自动回滚、PENDING=0 回写、卷双写 - Redis 容器改名密码迁移;备份失败默认 WARN;update.sh 管道 ROOT 回退
33 lines
1.2 KiB
Bash
Executable File
33 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# Nexus 6.0 — 一键更新(拉代码 + 重建镜像 + 重启)
|
||
#
|
||
# 已在 /opt/nexus:
|
||
# bash deploy/update.sh
|
||
# bash deploy/update.sh --no-cache # 强制无缓存重建(entrypoint/Dockerfile 变更后)
|
||
#
|
||
# 远程一条命令(推荐在仓库目录执行,管道模式会回退 /opt/nexus):
|
||
# cd /opt/nexus && bash deploy/update.sh
|
||
# curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/update.sh" | bash
|
||
#
|
||
set -euo pipefail
|
||
|
||
_resolve_nexus_root() {
|
||
local src="${BASH_SOURCE[0]:-}"
|
||
if [[ -n "$src" && "$src" != /dev/fd/* && "$src" != "-" && -f "$src" ]]; then
|
||
cd "$(dirname "$(readlink -f "$src")")/.." && pwd
|
||
return
|
||
fi
|
||
if [[ -d /opt/nexus ]]; then
|
||
echo "警告: 通过管道执行无法解析脚本路径,已回退 /opt/nexus;推荐: cd /opt/nexus && bash deploy/update.sh" >&2
|
||
echo /opt/nexus
|
||
return
|
||
fi
|
||
echo "错误: 无法定位 Nexus 根目录;请 cd /opt/nexus && bash deploy/update.sh" >&2
|
||
exit 1
|
||
}
|
||
|
||
ROOT="$(_resolve_nexus_root)"
|
||
|
||
NEXUS_ROOT="$ROOT" bash "$ROOT/deploy/install-nx-cli.sh" 2>/dev/null || true
|
||
exec bash "$ROOT/deploy/nexus-1panel.sh" upgrade "$@"
|