Added web hooks functionality

This commit includes:

 * Projects can have zero or more WebHooks.
 * The PostReceive job will ask a project to execute any web hooks defined for that project.
 * WebHook has a URL, we post Github-compatible JSON to that URL.
 * Failure to execute a WebHook will be silently ignored.
This commit is contained in:
Ariejan de Vroom 2011-12-14 17:38:52 +01:00
parent 56fc53e8d8
commit edab46e9fa
14 changed files with 295 additions and 4 deletions

View file

@ -1,5 +1,8 @@
class PostReceive
def self.perform(reponame, oldrev, newrev, ref)
puts "[#{reponame}] #{oldrev} => #{newrev} (#{ref})"
project = Project.find_by_path(reponame)
return false if project.nil?
project.execute_web_hooks(oldrev, newrev, ref)
end
end