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:
authorGabriel Mazetto <gabriel@gitlab.com>2016-04-15 14:08:22 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-04-19 12:00:30 +0300
commitee1090e2b2bc7b3762f6e2775f3fd15e92ae212b (patch)
tree9df863f27349ca2a95d0e6f16d99b85d4806d992 /app/services/git_push_service.rb
parent53a1d705fe536ad373faa77ba1ef5196ff49a98b (diff)
Added System Hooks for push and tag_push
Code is based on Project Webhooks, removing deprecations and without commits listing.
Diffstat (limited to 'app/services/git_push_service.rb')
-rw-r--r--app/services/git_push_service.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index dc74c02760b..25d8e2cf052 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -73,6 +73,7 @@ class GitPushService < BaseService
@project.update_merge_requests(params[:oldrev], params[:newrev], params[:ref], current_user)
EventCreateService.new.push(@project, current_user, build_push_data)
+ SystemHooksService.new.execute_hooks(build_push_data_system_hook.dup, :push_hooks)
@project.execute_hooks(build_push_data.dup, :push_hooks)
@project.execute_services(build_push_data.dup, :push_hooks)
CreateCommitBuildsService.new.execute(@project, current_user, build_push_data)
@@ -138,6 +139,11 @@ class GitPushService < BaseService
build(@project, current_user, params[:oldrev], params[:newrev], params[:ref], push_commits)
end
+ def build_push_data_system_hook
+ @push_data_system ||= Gitlab::PushDataBuilder.
+ build_system(@project, current_user, params[:oldrev], params[:newrev], params[:ref])
+ end
+
def push_to_existing_branch?
# Return if this is not a push to a branch (e.g. new commits)
Gitlab::Git.branch_ref?(params[:ref]) && !Gitlab::Git.blank_ref?(params[:oldrev])