如何结合 Vagrant 和 Jenkins 打造完美的持续集成环境? [英] How to combine Vagrant with Jenkins for the perfect Continuous Integration Environment?

查看:23
本文介绍了如何结合 Vagrant 和 Jenkins 打造完美的持续集成环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您的项目需要运行一些软件要求(例如:特定版本的 Apache、PHP 版本、MySQL 数据库实例和其他一些软件).

你已经发现了 Vagrant,所以你的虚拟环境已经设置好了.您可以从配置文件和说明书中创建盒子.

您还了解了持续集成系统的优势,例如 Jenkins.

现在您想结合这两个世界(Vagrant 和 Jenkins)来获得完美的持续集成环境.更具体地说,您不希望在运行 Jenkins 的机器上安装项目所需的软件,而是希望使用 Vagrant 提供的虚拟环境在其之上定期构建您的项目.CI 软件 (Jenkins) 将为您构建 Vagrant box,并在其上构建和测试您的项目.

您将如何设置您的环境来实现这一目标?

解决方案

这是一个很好的构建系统解决方案,我的建议:

  1. 您当前的 jenkins 作为主 CI 工作(可能由用户 jenkins 启动)
  2. 在同一台机器或另一台机器上创建另一个用户作为詹金斯从机模式
    • jenkins slave 可以从 jenkins master 中调用,它可以使用不同的用户,比如 vagrant,对 vagrant 有权限和环境,因此不会干扰原来的 jenkins master 服务器
    • 创建您的基本 vagrant box,然后可以重复使用它来加速您的部署
  3. 大部分安装信息(包)可以由 puppet(或厨师)管理,以加载到您的 vm 框中.

也许你可以看看 veewee,它可以在飞行中创建 vagrant box.p>

这里是 使用 Jenkins CI 和 Vagrant 让 CI 更容易作为我的建议指南.

You have a project which has got some SW requirements to run (e.g.: a specific version of Apache, a version of PHP, an instance of a MySQL database and a couple of other pieces of software).

You have already discovered Vagrant, so your virtual environment is all setup. You can create boxes out of your configuration files and cookbooks.

You have also understood the advantages of a Continuous Integration system such as Jenkins.

Now you would like to combine these two worlds (Vagrant and Jenkins) to get the perfect Continuous Integration Environment. To be more specific, you would like not to install the SW required by your project on the machine running Jenkins, but you would like to use the virtual environment provided by Vagrant to periodically build your project on the top of it. The CI software (Jenkins) will build the Vagrant box for you and build and test your project on the top of it.

How would you setup your environment to achieve this?

解决方案

it is a good solution for build system, my suggestion:

  1. Your current jenkins works as master CI (probably started by user jenkins)
  2. Create another user in same machine or another machine to work as jenkins slave mode
    • jenkins slave can be invoked from jenkins master, and it can use different user like vagrant who had permission and environment for vagrant, therefore it will not interfere the original jenkins master server
    • create your base vagrant box, then it can be reused to speedup for your deployment
  3. Most of the installation information (packages) could be managed by puppet (or chef) to be loaded into your vm box.

Probably you can take a look at veewee, which can create vagrant box on fly.

Here is the Make CI easier with Jenkins CI and Vagrant for my guideline for this suggestion.

这篇关于如何结合 Vagrant 和 Jenkins 打造完美的持续集成环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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