Files
plane-gptproto-integration/deploy/local/pull-plane.sh
T
carlandCursor 0136c15274 Initial commit: Plane 自部署与 gptproto AI 集成
包含本地/远程部署脚本、AI Agent 服务、Dashboard 与 QA 验证。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 11:37:41 +08:00

36 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# pull-plane.sh — fetch official Plane v1.3.0 from GitHub (idempotent).
# Reads from GitHub only; never piped install scripts.
set -euo pipefail
RELEASE="${PLANE_RELEASE:-v1.3.0}"
REPO_URL="https://github.com/makeplane/plane.git"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SRC_DIR="${SCRIPT_DIR}/src"
log() { printf '[pull-plane] %s\n' "$*"; }
if [[ -d "${SRC_DIR}/.git" ]]; then
CURRENT_TAG="$(git -C "${SRC_DIR}" describe --tags --exact-match 2>/dev/null || echo "")"
if [[ "${CURRENT_TAG}" == "${RELEASE}" ]]; then
log "src already at ${RELEASE}; nothing to do."
exit 0
fi
log "src exists but tag is '${CURRENT_TAG:-unknown}'; updating to ${RELEASE}."
git -C "${SRC_DIR}" fetch --depth 1 origin "refs/tags/${RELEASE}:refs/tags/${RELEASE}"
git -C "${SRC_DIR}" checkout "tags/${RELEASE}"
exit 0
fi
if [[ -e "${SRC_DIR}" ]]; then
log "ERROR: ${SRC_DIR} exists but is not a git repo. Refusing to overwrite." >&2
exit 1
fi
log "cloning ${REPO_URL} @ ${RELEASE} into ${SRC_DIR}"
git clone --branch "${RELEASE}" --depth 1 "${REPO_URL}" "${SRC_DIR}"
log "cloned. Verifying tag…"
git -C "${SRC_DIR}" describe --tags --exact-match
log "done."