Files
Nexus/scripts/git-push.sh
T
Nexus Deploy beb802802a chore: 添加 scripts/git-push.sh 与本地 Gitea secrets 约定
push 读取 deploy/nexus-1panel.secrets.sh(gitignore),clone/pull 仍可匿名。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 11:22:07 +08:00

15 lines
573 B
Bash

#!/usr/bin/env bash
# Push to Gitea using deploy/nexus-1panel.secrets.sh (not committed).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SECRETS="${ROOT}/deploy/nexus-1panel.secrets.sh"
if [[ -f "$SECRETS" ]]; then
# shellcheck disable=SC1090
source "$SECRETS"
fi
HOST="${NEXUS_GITEA_HOST:-66.154.115.8:3000}"
REPO="${NEXUS_GITEA_REPO:-admin/Nexus.git}"
TOKEN="${NEXUS_GITEA_TOKEN:?缺少 NEXUS_GITEA_TOKEN,请配置 $SECRETS}"
BRANCH="${1:-main}"
GIT_TERMINAL_PROMPT=0 git -C "$ROOT" push "http://admin:${TOKEN}@${HOST}/${REPO}" "$BRANCH"