git_tag_push_service.rb 583 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
6
    @push_data = create_push_data(oldrev, newrev, ref)
7

8
    EventCreateService.new.push(project, user, @push_data)
9
    project.repository.expire_cache
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
13

    true
14
15
16
17
  end

  private

18
  def create_push_data(oldrev, newrev, ref)
19
    Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
20
21
  end
end