社区初始化

This commit is contained in:
lxp
2026-10-14 10:26:20 +08:00
parent fc95e7968b
commit e23d249bd0
60 changed files with 4994 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
COMMUNITY_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ -f "$COMMUNITY_ROOT/.env" ]]; then
set -a
source "$COMMUNITY_ROOT/.env"
set +a
fi
export SPRING_PROFILES_ACTIVE="${SPRING_PROFILES_ACTIVE:-test}"
cd "$COMMUNITY_ROOT"
mvn -q -DskipTests package
exec java -Djava.awt.headless=true -jar community-api/target/community-api-0.0.1-SNAPSHOT.jar "$@"
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
"""在临时 H2 数据库运行真实 Gitea 测试,清理本次创建的临时仓库。"""
import os
from pathlib import Path
import shlex
import subprocess
root = Path(__file__).resolve().parent.parent
environment = os.environ.copy()
config = root / ".env"
if config.exists():
for line in config.read_text().splitlines():
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
parsed = shlex.split(value)
if parsed:
environment[key] = parsed[0]
if not environment.get("GITEA_TOKEN"):
raise SystemExit("请先配置 GITEA_TOKEN 和 GITEA_ORGANIZATION")
environment["COMMUNITY_LIVE_GITEA"] = "true"
raise SystemExit(subprocess.call([
"mvn", "-q", "-Dtest=GiteaLiveTest", "-Dsurefire.failIfNoSpecifiedTests=false", "test"
], cwd=root, env=environment))