请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

bmabey/continuous-cooking: Chef recipes for continuous integration, code review, ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

bmabey/continuous-cooking

开源软件地址:

https://github.com/bmabey/continuous-cooking

开源编程语言:

Shell 54.7%

开源软件介绍:

Continuous Cooking

Chef cookbooks for continuous integration, code review, and overall code management. The following cookbooks are provided: Gitosis, Hudson, Gerrit.

I only aim to support ubuntu and nginx, but adding Apache or other platforms should be easy if you have the need.

Why?

I've set up many CI servers in my day. It is usually the first thing I do at a new job if I find out they don't have one running already. Setting up a CI program is an easy task. Hudson (my favorite open source CI server) is especially dead simple to set up and doesn't take more than a minute. However, I tend to always get bogged down with other environmental issues. Such as needing to run multiple versions of Ruby (via rvm), or remembering to install other dependencies. Additionaly, if you need to fire up additional Hudson slaves in the cloud then having the process automated is a must. The goal of this project is to automate this to a point where anyone can start up a base install and have a decent CI program and environment up and running within minutes.

Whats Done

  • Hudson

    • Ability to declare what plugins to install

      • Common base ones are installed by default (i.e git) and are configurable via an attribute.
    • nginx recipe for proxying

    • Ruby recipe to add RVM support to hudson user (see FAQ for info on how to use it)

      • Flexible RVM cookbook to declare needed ruby versions and base gems (i.e bundler).
      • Installs common ruby plugins.
  • Gitosis (see below on how to use)

  • Gerrit - right now it is set to proxy behind nginx, but it would not be hard to change.

  • Headless browser - Xvfb (in memory headless xserver) and Firefox are ready to go (see FAQ for info on how to use it)

TODO

  • Cloud bootstrapping script

  • Documentation

  • Allow Hudson to use the RVM command without requiring every job to source the rvm script each time.

  • Create/publish base vagrant image?

    • Maybe have a base image with dummy Hudson/Gerrit projects setup to give idea of workflow?

Hacking and Experimenting With Setups

I'm using Vagrant to help develop the cookbooks. See the Vagrant site/docs for more info on how Vagrant works.

To use vagrant you will need to have installed VirtualBox and ran it once. After that these commands should get you up and running:

gem install bundler
bundle install
git submodule update --init
bundle install
bundle exec vagrant box add lucid64 http://s3.lds.li/vagrant/lucid64.box
bundle exec vagrant up

Note: Prefixing all your vagrant commands with bundle exec gets old fast so a ./vagrant wrapper script is provided.

This will take a while the first time since it is downloading all the needed packages. If this runs successfully you should be able to hit the various services:

(see Troubleshooting section if any of these doesn't appear to be running)

For the services proxied via nginx you will need to add the appropriate entries to your hosts file. One easy way to do this is with the ghost gem:

gem install ghost
sudo ghost add hudson.codebox
sudo ghost add gerrit.codebox

To rerun chef you can either type ./vagrant reload or ./vagrant provision. The provision command is much faster and is preferred. The reload command will restart the VM, remount the FS, and setup the port forwarding.

Gitosis

To experiment with gitosis you will need to have vagrant write to your ssh config:

./vagrant ssh-config >> ~/.ssh/config

Now you will be able to clone the gitosis repo:

git clone gitosis@vagrant:gitosis-admin.git

Once that is done you can modify the gitosis.conf as you normally would to manage repositories.

Gerrit

To learn more about Gerrit see the docs. This wiki page provides a nice summary as well.

Please note that using both Gerrit and Gitosis at the same time doesn't really make sense. Gerrit provides much finer-grain permission control that gitosis does. They are both setup on the vagrant box just to provide a playground for both. When you use the cookbooks on your own server you should choose one or the other.

Troubleshooting

  • Hudson isn't running after ./vagrant up - When bootstrapping for the first time Hudson sometimes fails to restart after installing the plugins (something about being restarted too soon I think). If this happens you simply need to restart the service by sshing in and typing sudo /etc/init.d/hudson restart.

  • Gerrit isn't running after ./vagrant up - Again, try running the service manually: sudo /etc/init.d/gerrit restart.

Please see the wiki's FAQ page for more information.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap