Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriejan de Vroom <ariejan@ariejan.net>2011-12-14 20:38:52 +0400
committerAriejan de Vroom <ariejan@ariejan.net>2011-12-14 20:38:52 +0400
commitedab46e9fa5f568b1423c0021e81d30453d7dc1e (patch)
tree8efba8b082a534e1a069f4566d55d6117951e6ba /app/workers
parent56fc53e8d870b70ca66332daeb6da39ab0eb5ce7 (diff)
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.
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/post_receive.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 01620f7818a..d79f4599d80 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -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