Skip to content
edavis10 edited this page Sep 13, 2010 · 27 revisions

As an example on how to use Cerberus, we will follow through the steps of using CI to build another one of my projects, BBRuby.

First we must install the gem.

$ sudo gem install cerberus

First off, let’s edit our Cerberus config file and set some defaults for all our projects

$ vim ~/.cerberus/config.yml

Personally, I want all my projects to send alerts via email and twitter, so this is what my config.yml looks like

publisher:
  active: mail twitter
  mail:
    address:  smtp.myserver.com
    port: 587
    domain: mydomain.com
    authentication: plain
    user_name: [email protected]
    password: mypassword
  twitter:
    login: twitter_login
    password: twitter_password

Next, we will add BBRuby to the Cerberus projects list

$ cerberus add git://github.com/cpjolicoeur/bb-ruby.git SCM=git [email protected]

As a check, I’m going to check out the project config file as well to make sure everything looks good

$ vim ~/.cerberus/config/bb-ruby.yml

Here are the contents of my bb-ruby.yml

publisher:
  mail:
    recipients: [email protected]
scm:
  type: git
  url: git://github.com/cpjolicoeur/bb-ruby.git

Everything appears to be configured properly, so let’s go ahead and run Cerberus for the first time:

$ cerberus build bb-ruby

The very first time cerberus is run on a new project, all the publishers will receive an alert letting you know the project was setup successfully. (output will resemble the following)

[bbruby] Cerberus set up for project (#b32d271a0dfd38dcbd9799f035ac494f757d4506)

Subsequent builds of cerberus will deliver an error alert if the build is broken

[bbruby] Build broken by Craig P Jolicoeur ([email protected]) (#15ad949b6cb7ca29996dd333b94f6c97e1018b16)

Other types of alerts will let you know if the build is still broken but getting better or getting worse, or if the build was fixed and is now successful. Once the project is successfully built, you will only receive alerts once the build breaks again. If the repository stays in successful build condition, cerberus does not alert you every time to let you know everything is still OK.

Clone this wiki locally