如何管理不同应用实例的poperty文件?

发布于 2024-09-12 00:25:39 字数 281 浏览 3 评论 0原文

我们的系统安装在 4 个区域

  • 欧洲
  • 美国
  • 亚洲
  • 日本

每个区域都有 3 种类型的环境

  • 开发
  • 测试
  • 产品

对于每个环境,我们都有属性文件,在其中指定实例的配置。现在我们总共有 12 个具有大量属性的文件。 问题在于处理属性文件中的更改并对其进行管理非常困难。

有谁知道有什么工具可以帮助以最少的手动工作来编辑/添加/删除属性?

We have 4 regions in which our system is installed

  • Europe
  • USA
  • ASIA
  • Japan

Each region has 3 types of environment

  • dev
  • test
  • prod

For each environment we have property file where we are specifying configurations for instances. In whole we have now 12 files with huge amount of properties.
The problem is that it is very hard to handle changes in properties files and manage them.

Does anybody know any tool that could help to edit/add/delete properties with minimal manual work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请远离我 2024-09-19 00:25:39

您可以使用版本控制的模板和替换文件来管理它。

模板文件将包含所有属性,以及要替换的值的标记

  some.property.never.changes=Literal value
  some.property.which.changes=--A_SUBSTITUTION_KEY--
  another.property.never.changes=Literal value
  another.property.which.changes=--ANOTHER_SUBSTITUTION_KEY--

替换文件将包含特定实例的替换值

  A_SUBSTITUTION_KEY=A literal value
  ANOTHER_SUBSTITUTION_KEY=Another literal value

使用 Ant 等构建工具将替换值轻松合并到创建新文件的模板中。

您可以选择仅对模板和替换文件进行版本控制,也可以选择对合并的输出文件进行版本控制。

You could manage this using version controlled template and substitution files.

A template file would contain all properties, with markers for values to be substituted

  some.property.never.changes=Literal value
  some.property.which.changes=--A_SUBSTITUTION_KEY--
  another.property.never.changes=Literal value
  another.property.which.changes=--ANOTHER_SUBSTITUTION_KEY--

A substitution file would contain substitution values for a particular instance

  A_SUBSTITUTION_KEY=A literal value
  ANOTHER_SUBSTITUTION_KEY=Another literal value

Easy to merge substitution values into template creating a new file using build tool such as Ant.

You could choose to version control just the template and substitution files, or you could choose to version control the merged output files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文