diff --git a/scripts/test-model-conversion-update.py b/scripts/test-model-conversion-update.py index cfe5ab7..fed66bd 100644 --- a/scripts/test-model-conversion-update.py +++ b/scripts/test-model-conversion-update.py @@ -122,6 +122,17 @@ with tempfile.TemporaryDirectory(prefix='easyai-conversion-update-') as temporar assert result.returncode != 0 assert '应用更新成功' not in result.stdout if name == 'bash': + log.write_text('') + result = run(command, root, {**env, 'UPDATE_SERVICES': 'easyai-server easyai-web', 'UPDATE_RELEASE_VERSION': '3.25.0.20261009.3'}) + assert result.returncode == 0, result.stdout + result.stderr + core_values = dict(line.split('=', 1) for line in (root / '.env').read_text().splitlines() if '=' in line and not line.startswith('#')) + assert core_values['VERSION'] == '3.25.0.20261009.3' + assert core_values['MODEL_CONVERSION_WORKER_VERSION'] == values['MODEL_CONVERSION_WORKER_VERSION'] + assert ['compose', 'pull', 'easyai-server', 'easyai-web'] in calls(log) + assert ['compose', 'up', '-d', '--no-deps', 'easyai-server', 'easyai-web'] in calls(log) + assert not any('model-conversion-worker' in call for call in calls(log) if call[:2] in [['compose', 'pull'], ['compose', 'up']]) + values = core_values + print('bash: core-only release preserves non-target Worker pin passed') companion_env = {**env, 'UPDATE_SERVICES': 'ws-gateway easyai-updater', 'UPDATE_GATEWAY_VERSION': '3.25.0.20261009', 'UPDATE_UPDATER_VERSION': '3.25.0.20261009'} diff --git a/update.sh b/update.sh index 70f197a..1736a30 100755 --- a/update.sh +++ b/update.sh @@ -202,7 +202,10 @@ bash ./scripts/init-infrastructure-update-env.sh "$SCRIPT_DIR" if [ -n "${UPDATE_RELEASE_VERSION:-}" ]; then write_env_value .env VERSION "$UPDATE_RELEASE_VERSION" - write_env_value .env MODEL_CONVERSION_WORKER_VERSION "$UPDATE_RELEASE_VERSION" + # 定向发布主服务时保留未参与的 Worker 固定版本。 + if [ -z "${UPDATE_SERVICES:-}" ] || [[ " ${UPDATE_SERVICES} " == *" model-conversion-worker "* ]]; then + write_env_value .env MODEL_CONVERSION_WORKER_VERSION "$UPDATE_RELEASE_VERSION" + fi echo "📌 已固定本次发布版本: $UPDATE_RELEASE_VERSION" fi