1ae21eef5b
网站登录 → 创建项目 Git Token → clone → 本地修改、commit → push main → 网站工作区刷新后显示最新内容 → 网站手动发布到社区
27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""使用随机测试用户/仓库验证真实 HTTPS Git 接入;不修改已有项目。"""
|
|
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_BASE_URL、GITEA_ORGANIZATION 与可创建测试用户的 GITEA_TOKEN')
|
|
if environment.get('DB_URL', '').startswith('jdbc:mysql:'):
|
|
environment.setdefault('GIT_GATEWAY_MYSQL', 'true')
|
|
environment.update(VIBEMAKE_LIVE_GITEA='true', AI_ENABLED='false', VIBEMAKE_AI_ENABLED='false', OSS_ENABLED='false')
|
|
raise SystemExit(subprocess.call([
|
|
'mvn', '-q', '-Dtest=GitGatewayLiveTest', '-Dsurefire.failIfNoSpecifiedTests=false', 'test'
|
|
], cwd=root, env=environment))
|