git_tag_push_service.rb 587 Bytes
Newer Older
1
2
class GitTagPushService
  attr_accessor :project, :user, :push_data
3

4
  def execute(project, user, oldrev, newrev, ref)
5
    @project, @user = project, user
Douwe Maan's avatar
Douwe Maan committed
6
7
    
    @push_data = build_push_data(oldrev, newrev, ref)
8

9
    EventCreateService.new.push(project, user, @push_data)
10
    project.execute_hooks(@push_data.dup, :tag_push_hooks)
Douwe Maan's avatar
Douwe Maan committed
11
    project.execute_services(@push_data.dup, :tag_push_hooks)
12

Douwe Maan's avatar
Douwe Maan committed
13
14
    project.repository.expire_cache

15
    true
16
17
18
19
  end

  private

Douwe Maan's avatar
Douwe Maan committed
20
  def build_push_data(oldrev, newrev, ref)
21
    Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
22
23
  end
end