Created
May 10, 2013 07:14
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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