Created
November 24, 2011 13:28
-
-
Save eightbitraptor/1391348 to your computer and use it in GitHub Desktop.
build status monitor
This file contains 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 'rack' | |
require 'jenkins-remote-api' | |
class OhGodBuildBot | |
def initialize | |
@jenkins = Ci::Jenkins.new('http://172.21.6.241:8080/') | |
end | |
def failing? | |
@jenkins.list_all_job_names.map{ |job| @jenkins.current_status_on_job(job) }.include? "failure" | |
end | |
def build_status_page | |
colour = failing? ? "red" : "green" | |
return ["<body style='background-color: #{colour}; position: absolute; width: 100%; height: 100%'></body>"] | |
end | |
def call(env) | |
[200, {"Content-Type" => "text/html"}, OhGodBuildBot.new.build_status_page] | |
end | |
end | |
run OhGodBuildBot.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment