fix: 调整 NAS 部署配置与脚本清理逻辑

This commit is contained in:
wkc
2026-03-16 14:54:42 +08:00
parent 7a5ae3f1cc
commit 0c2d738cfe
5 changed files with 31 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ REPO_ROOT = Path(__file__).resolve().parents[2]
DEPLOY_PS1 = REPO_ROOT / "deploy" / "deploy.ps1"
DEPLOY_BAT = REPO_ROOT / "deploy" / "deploy-to-nas.bat"
DOCKER_COMPOSE = REPO_ROOT / "docker-compose.yml"
ENV_EXAMPLE = REPO_ROOT / ".env.example"
LSFX_MOCK_COMPOSE = REPO_ROOT / "lsfx-mock-server" / "docker-compose.yml"
def run_powershell(*args):
@@ -79,3 +81,17 @@ def test_compose_exposes_lsfx_mock_port_via_backend_namespace():
assert '${LSFX_MOCK_PORT:-62320}:8000' in compose_text
assert 'network_mode: "service:backend"' in compose_text
def test_compose_defaults_backend_profile_to_nas():
compose_text = DOCKER_COMPOSE.read_text(encoding="utf-8")
env_text = ENV_EXAMPLE.read_text(encoding="utf-8")
assert '${SPRING_PROFILES_ACTIVE:-nas}' in compose_text
assert 'SPRING_PROFILES_ACTIVE=nas' in env_text
def test_lsfx_mock_standalone_compose_exposes_62320():
compose_text = LSFX_MOCK_COMPOSE.read_text(encoding="utf-8")
assert '"62320:8000"' in compose_text