如何自动化开发环境设置? [英] How to automate development environment setup?

查看:23
本文介绍了如何自动化开发环境设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当有新开发人员加入团队或开发人员使用的计算机发生变化时,开发人员都需要做大量工作来设置本地开发环境以使当前项目正常工作.作为一个 SCRUM 团队,我们正在尝试使包括部署和测试在内的一切工作自动化,所以我要问的是:是否有工具或实践可以使本地开发环境设置自动化?

Every time a new developer joins the team or the computer a developer is using changes, the developer needs to do lots of work to setup the local development environment to make the current project work. As a SCRUM team we are trying to automate everything including deployment and tests so what I am asking is: is there a tool or a practice to make local development environment setup automated?

例如要设置我的环境,首先我必须安装 eclipse,然后是 SVN、Apache、Tomcat、MySQL、PHP.之后我填充了数据库,我不得不对各种配置文件等做一些小的更改......有没有办法将这种劳动减少到一键式?

For example to setup my environment, first I had to install eclipse, then SVN, Apache, Tomcat, MySQL, PHP. After that I populated the DB and I had to do minor changes in the various configuration files etc... Is there a way to reduce this labor to one-click?

推荐答案

有几个选项,有时组合使用这些选项很有用:

There are several options, and sometimes a combination of these is useful:

  • 自动安装
  • 磁盘映像
  • 虚拟化
  • 源代码控制

各种选项的详细信息:

  1. 自动安装用于自动安装和配置工作站的各种服务、工具和配置文件的工具:

  1. Automated Installation Tools for automating installation and configuration of a workstation's various services, tools and config files:

  • Puppet 具有学习曲线但功能强大.您定义机器类别(开发箱、Web 服务器等),然后它会执行安装、配置和保持机器处于正确状态所需的操作.您要求单击一下,但 Puppet 默认情况下是零单击,因为它会定期检查您的机器以确保它仍按需要进行配置.它将检测文件或模式何时发生更改,并修复问题.我目前使用它来维护少数 RedHat Linux 机器,尽管它能够处理数千个.(截至 2009-05-08 不支持 Windows).
  • Cfengine 是另一个.我已经在一家拥有 70 名工程师使用 RedHat Linux 的商店中成功地看到了这一点.它的局限性是 Puppet 的部分原因.
  • SmartFrog 是另一种配置主机的工具.它确实支持 Windows.
  • 外壳脚本.RightScale 提供了如何配置 Amazon EC2 的示例图像使用 shell 脚本.
  • 安装软件包.在 Unix 机器上,完全可以用包来做到这一点,而在 Windows 上,msi 可能是一种选择.例如,RubyWorks 为您提供了一个完整的 Ruby on Rails 堆栈,所有这一切都通过安装一个包来依次安装其他包通过依赖项.
  • Puppet has a learning curve but is powerful. You define classes of machines (development box, web server, etc.) and it then does what is necessary to install, configure, and keep the box in the proper state. You asked for one-click, but Puppet by default is zero-click, as it checks your machine periodically to make sure it is still configured as desired. It will detect when a file or mode has been changed, and fix the problem. I currently use this to maintain a handful of RedHat Linux boxes, though it's capable of handling thousands. (Does not support Windows as of 2009-05-08).
  • Cfengine is another one. I've seen this used successfully at a shop with 70 engineers using RedHat Linux. Its limitations were part of the reason for Puppet.
  • SmartFrog is another tool for configuring hosts. It does support Windows.
  • Shell scripts. RightScale has examples of how to configure an Amazon EC2 image using shell scripts.
  • Install packages. On a Unix box it's possible to do this entirely with packages, and on Windows msi may be an option. For example, RubyWorks provides you with a full Ruby on Rails stack, all by installing one package that in turn installs other packages via dependencies.

磁盘映像当然还有磁盘映像工具 用于存储已配置主机的映像,以便可以将其还原到另一台主机.与虚拟化一样,这对测试盒特别有用,因为很容易将事物恢复到干净的状态.保持事物持续更新仍然是一个问题——是否值得制作新映像来传播配置文件更改?

Disk Images Then of course there are also disk imaging tools for storing an image of a configured host such that it can be restored to another host. As with virtualization, this is especially nice for test boxes, since it's easy to restore things to a clean slate. Keeping things continuously up-to-date is still an issue--is it worth making new images just to propagate a configuration file change?

虚拟化 是另一种选择,例如制作Xen、VirtualPC 或 VMWare 映像的副本以创建新主机.这对于测试盒特别有用,因为无论测试造成什么混乱,您都可以轻松恢复到干净的已知状态.与磁盘映像工具一样,与使用自动安装/配置工具相比,保持主机最新需要更多的手动步骤和警惕.

Virtualization is another option, for example making copies of a Xen, VirtualPC, or VMWare image to create new hosts. This is especially useful with test boxes, as no matter what mess a test creates, you can easily restore to a clean, known state. As with disk imaging tools, keeping hosts up-to-date requires more manual steps and vigilance than if an automated install/config tool is used.

源代码控制一旦您安装/配置了必要的工具,那么构建就应该是从源代码存储库中检查所需的内容并构建它.

Source Code Control Once you've got the necessary tools installed/configured, then doing builds should be a matter of checking out what's needed from a source code repository and building it.

目前我使用上述的组合来自动化这个过程,如下所示:

Currently I use a combination of the above to automate the process as follows:

  • 从在 VMWare 来宾上安装准系统操作系统开始
  • 运行 shell 脚本来安装 Puppet 并从源代码控制中检索其配置
  • Puppet 来安装工具/组件/配置
  • 从源代码控制中检查文件以构建和部署我们的网络应用程序

这篇关于如何自动化开发环境设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆