持续集成:管理针对不同环境的配置文件?
我正在为我们的开发设置 CI,并想了解管理针对不同环境的配置文件的想法/最佳实践。
首先想到的方法是将特定于环境的配置文件保存在版本控制下的不同目录中,并使用 NAnt 等构建平台将正确的配置文件按顺序复制到环境中:
例如,我的 CI 流程基本上如下此过程:
subversion -> 1. buildarea -> 2. test env -> 3. beta. env. -> 4. live
在版本控制下创建三个名为:的文件夹,
dev.config/: global.asa, app.config
test.config/: gloval.asa, app.config
live.config/: global.asa, app.config
并在连续的步骤 2、3、4 中使用 NAnt 将正确的配置文件复制到环境中。但也许这可能不是很理想。
I'm setting up a CI for our development and wanting to know ideas/best practices on managing configuration files targeting different environments.
The first approach that comes to mind is to keep environment-specific configuration files in different directories under version control, and use a build platform such as NAnt to copy the right configuration file to an environment in order:
For instance, my CI process basically follows this process:
subversion -> 1. buildarea -> 2. test env -> 3. beta. env. -> 4. live
have three folders under version control called:
dev.config/: global.asa, app.config
test.config/: gloval.asa, app.config
live.config/: global.asa, app.config
and during the successive steps 2, 3, 4 use NAnt to copy the right configuration file into the environment. But perhaps that might not be very ideal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更注重持续交付而不是持续集成的工具将对您要部署到的环境以及部署过程进行建模。好的将允许您特定环境的特定参数,并更新模板配置文件(并保证秘密内容的安全)。我认为这与木偶的策略类似。
Tools focused more on continuous delivery rather than continuous integration will model the environments you're deploying to as well as the deployment process. Good ones will allow you to specific environment specific parameters, and update a template configuration file (and keep secret stuff secure). I think that's a similar strategy to puppet.