包含本地/远程部署脚本、AI Agent 服务、Dashboard 与 QA 验证。 Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
1.2 KiB
Bash
Executable File
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."
|