fix(deploy): 兼容旧配置迁移并支持固定版本验收

This commit is contained in:
2026-10-03 07:56:12 +08:00
parent c252a2f9ad
commit e29d203bb7
6 changed files with 341 additions and 1 deletions
+10
View File
@@ -99,6 +99,16 @@ with tempfile.TemporaryDirectory(prefix='easyai-conversion-update-') as temporar
assert result.returncode == 0, result.stdout + result.stderr
assert original == (root / '.env').read_bytes(), 'repeat changes deployment settings'
log.write_text('')
original = (root / '.env').read_bytes()
result = run(command, root, {**env, 'UPDATE_RELEASE_VERSION': 'latest;unsafe'})
assert result.returncode != 0
assert original == (root / '.env').read_bytes()
assert not any(c[:2] in [['compose', 'pull'], ['compose', 'up']] for c in calls(log))
result = run(command, root, {**env, 'UPDATE_RELEASE_VERSION': '3.23.0.20261003'})
assert result.returncode == 0, result.stdout + result.stderr
values = dict(line.split('=', 1) for line in (root / '.env').read_text().splitlines() if '=' in line and not line.startswith('#'))
assert values['VERSION'] == values['MODEL_CONVERSION_WORKER_VERSION'] == '3.23.0.20261003'
log.write_text('')
result = run(command, root, {**env, 'UPDATE_SERVICES': 'easyai-server missing-service'})
assert result.returncode != 0
assert not any(c[:2] in [['compose', 'pull'], ['compose', 'up']] for c in calls(log))