Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Check the status of your cruise.rb or runcoderun.com build from your Ruby scripts.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CRUISE_URL
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 cruisestatus.gemspec
README.rdoc

Cruise Status

CruiseStatus allows your Ruby scripts to check the status of your project's build. Use this to abort check-ins when the build has failed, for example.

CruiseStatus currently supports checking builds run on cruisecontrol.rb or on runcoderun.com.

CruiseControl.rb Example:

To check a cruise.rb build, pass the url to the project RSS feed to CruiseStatus:

require "cruisestatus"

if CruiseStatus.new( 'http://my.cruise.com/projects.rss' ).pass?
  puts "Build passed!"
else
  abort "Build failed…Boo!"
end

RunCodeRun.com Example:

To check a build on runcoderun.com, simply pass the url for the json API:

require "cruisestatus"

if CruiseStatus.new( 'http://runcoderun.com/api/v1/json/tobytripp' ).pass?
  puts "Build passed!"
else
  abort "Build failed…boo!"
end

Command-line Usage:

The gem's binary is cruisestatus. Pass a URL to it and cruisestatus will check the build status at that URL and return a non-zero status if any of the builds reported there have failed.

Pass a `-p` option to prompt the user when a build has failed. If the user enters 'y' at the prompt, cruisestatus will return a zero status regardless of build failures.

For example:

$ cruisestatus -p http://runcoderun.com/api/v1/json/tobytripp

Build FAILURES: cruisestatus
Are you sure you want to check in? (y/n): y

$ echo $?
0

$ cruisestatus -p http://runcoderun.com/api/v1/json/tobytripp

Build FAILURES: cruisestatus
Are you sure you want to check in? (y/n): n

$ echo $?
1

You can use this to abort check-ins onto broken builds. (See the post-commit hook in github.com/tobytripp/git-pre-commit/blob/master/git-hooks/post-commit for example). As you know, if the CI build is broken, no one should be checking in new code unless they're fixing the build. You can use cruisestatus to help keep developers honest in that regard.

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request.

Build Status

runcoderun.com/tobytripp/cruisestatus

TODO

  • Cruise.java support?

Copyright

Copyright © 2010 Toby Tripp. See LICENSE for details.

Something went wrong with that request. Please try again.