Skip to content

Instantly share code, notes, and snippets.

@dziemid
Created May 10, 2013 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dziemid/5552891 to your computer and use it in GitHub Desktop.
Save dziemid/5552891 to your computer and use it in GitHub Desktop.
Check if a bamboo build is green from command line. Usage: ruby bamboo.rb http://server:port build-key
require 'open-uri'
def check(server, build)
open("#{server}/rest/api/latest/result/#{build}?max-results=1") do |io|
data = io.read
puts data.include?('state="Successful"') ? "#{build} - OK" : `open #{server}/browse/#{build}`
end
end
check(ARGV[0],ARGV[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment