流浪者的发展和 CI

Vagrant for development and CI

我想设置以下工作流程。

这将允许新的开发人员在几分钟内准备好在持续集成服务器使用的完全相同的环境中编写代码,并在虚拟机的帮助下部署到任何地方。

我想我可以用 Vagrant 和 Chef 试试这个,但我不确定它们是否真的适合那样使用。有什么想法吗?

Each project has a Vagrant file under version control and a Jenkins job that builds the virtual machine for every configuration change. This virtual machine is meant to be used both for continuous integration and development.

Vagrantfile 定义了您的应用程序环境应该是什么样子。 随着配置(Chef、Puppet、Ansible 或 Shell ...),您将为在您的项目中工作的每个团队成员创建完全相同的 VM。 然后您不需要创建 VM 并使用来自 CI 或开发人员的相同 VM 实例。每个人都会有自己的环境。

A developer joins a project. He grabs the corresponding virtual machine from Jenkins which is all setup and configured.

每个开发人员都将在他们的笔记本电脑上从同一个 Vagrantfile 启动一个 VM 运行ning - 无需共享 VM。

When the project's build job under Jenkins detects a change in the repository, it grabs the virtual machine as an artefact from the same job the developer used and runs the build

您可以使用 Jenkins vagrant-plugin 从与您的项目对应的相同 Vagrantfile 启动 VM。您不会 运行 来自现有 VM 的作业。

注意:如果您担心配置会花费太多时间,这就是您说要使用现有 VM 的原因,您可以创建一个安装了所有依赖项的新框并重新打包以将其用作新基础盒子