Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] config 加载器对 ARTUS_SERVER_ENV 的解析 Hook #186

Open
hyj1991 opened this issue Aug 30, 2022 · 3 comments
Open

[RFC] config 加载器对 ARTUS_SERVER_ENV 的解析 Hook #186

hyj1991 opened this issue Aug 30, 2022 · 3 comments
Assignees

Comments

@hyj1991
Copy link
Member

hyj1991 commented Aug 30, 2022

背景

配置加载-load-config

按照 SPEC 的约定,会提供一套 Hook 机制满足对 ARTUS_SERVER_ENV 的自定义解析,目前 core 中尚未实现,需要在此 RFC 先整理下自定义 ARTUS_SERVER_ENV 字段的解析需求,再看如何实现。

目前收集到的需求主要为:

多独立单元部署

同一套代码需要在多个不同的包含完全独立的 dev, testprod 的部署单元进行部署,这就意味着只区分 dev, testprod 作为环境变量是不足够的,还需要能区分部署单元本身。

这样原本 env 的属性解析可能会需要拆分为 ${scope}_${env},其中 scope 为部署单元名称,env 和目前的设计则保持一致。

多配置合并

希望可以自定义多配置合并顺序:

config.${value1},${value2},${value3}.js

配置顺序自动按照 config.value1.js < config.value2.js < config.value3.js 合并。

@hyj1991
Copy link
Member Author

hyj1991 commented Aug 30, 2022

@noahziheng
Copy link
Member

noahziheng commented Aug 30, 2022

@hyj1991
Copy link
Member Author

hyj1991 commented Aug 30, 2022

2022-08-30 飞书视频会议讨论结论:

  • 目前无法支持任意配置组合
  • scope_evn 需求通过在 core 中提供钩子进行处理

@hyj1991 hyj1991 self-assigned this Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants