Skip to content

Instantly share code, notes, and snippets.

@coderberry
Created July 16, 2009 17:17
Show Gist options
  • Select an option

  • Save coderberry/148541 to your computer and use it in GitHub Desktop.

Select an option

Save coderberry/148541 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "rubygems"
require "integrity"
# If you want to add any notifiers, install the gems and then require them here
# For example, to enable the Email notifier: install the gem (from github:
#
# sudo gem install -s http://gems.github.com foca-integrity-email
#
# And then uncomment the following line:
#
# require "notifier/email"
# Load configuration and initialize Integrity
Integrity.new(File.dirname(__FILE__) + "/config.yml")
# You probably don't want to edit anything below
Integrity::App.set :environment, ENV["RACK_ENV"] || :production
Integrity::App.set :port, 8910
Integrity::Notifier::Base.class_eval {
def self.notify_of_build(build, config)
begin
Integrity.log "Notifying of build #{build.commit.short_identifier} using the #{to_s} notifier"
Timeout.timeout(8) { new(build.commit, config).deliver! }
rescue Timeout::Error
Integrity.log "#{to_s} notifier timed out"
false
end
end
}
run Integrity::App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment