Breakpoint CI (bpci)

Breakpoint CI is a Continuous Integration server based on defunkt/cijoe that we (Breakpoint developers) have:

  1. Made work.
  2. Tweaked/added things to our needs.
  3. Removed things that we don't (e.g. campfire support).

Quickstart

RubyGems:

$ gem install bpci
$ git clone git://github.com/you/yourrepo.git
$ bpci yourrepo

Boom. Navigate to http://localhost:4567 to see bpci in action. Check bpci -h for other options.

Basically you need to run bpci and hand it the path to a git repo. Make sure this isn't a shared repo: bpci needs to own it.

bpci looks for various git config settings in the repo you hand it. For instance, you can tell bpci what command to run by setting bpci.runner:

$ git config --add bpci.runner "rake -s test:units"

bpci doesn't care about Ruby, Python, or whatever. As long as the runner returns a non-zero exit status on fail and a zero on success, everyone is happy.

Need to do some massaging of your repo before the tests run, like maybe swapping in a new database.yml? No problem - bpci will try to run .git/hooks/after-reset if it exists before each build phase. Do it in there. Just make sure it's executable.

Want to notify IRC or email on test pass or failure? bpci will run .git/hooks/build-failed or .git/hooks/build-worked if they exist and are executable on build pass / fail. They're just shell scripts - put whatever you want in there.

Tip: your repo's HEAD will point to the commit used to run the build. Pull any metadata you want out of that scro.

** WARNING ** Do not run this against a git repo that has unpushed commits, as this will do a hard reset against the github remote and wipe out unpushed changes.

Other Branches

Want bpci to run against a branch other than master? No problem:

$ git config --add bpci.branch deploy

Queueing

bpci runs just one build at the time. If you expect concurrent push's to your repo and want joe to build each in a kind of queue, just set:

$ git config --add bpci.buildqueue true

bpci will save requests while another build runs. If more than one push hits bpci, it just picks the last after finishing the prior.

Campfire

** We are removing Campfire support from bpci **

Checkin' Status

Want to see how your build's doing without any of this fancy UI crap? Ping bpci for the lowdown:

curl http://localhost:4567/ping

bpci will return 200 OK if all is quiet on the Western Front. If bpci's busy building or your last build failed, you'll get 412 PRECONDITION FAILED.

Multiple Projects

Want CI for multiple projects? Just start multiple instances of bpci! It can run on any port - try bpci -h for more options.

If you're using Passenger, see this blog post from the upstream project.

HTTP Auth

Worried about people triggering your builds? Setup HTTP auth:

$ git config --add bpci.user your_username
$ git config --add bpci.pass your_password

GitHub Integration

Any POST to bpci will trigger a build. If you are hiding bpci behind HTTP auth, that's okay - GitHub knows how to authenticate properly.

Post-Receive URL

You can find the Post-Receive option under the 'Service Hooks' subtab of your project's "Admin" tab.

Daemonize

Want to run bpci as a daemon? Use nohup:

$ nohup bpci -p 4444 repo &

Questions? Concerns?

Issues Upstream