gitlab-org--gitlab-foss/app/services/git_tag_push_service.rb

22 lines
583 B
Ruby
Raw Normal View History

class GitTagPushService
attr_accessor :project, :user, :push_data
def execute(project, user, oldrev, newrev, ref)
@project, @user = project, user
@push_data = create_push_data(oldrev, newrev, ref)
EventCreateService.new.push(project, user, @push_data)
project.repository.expire_cache
project.execute_hooks(@push_data.dup, :tag_push_hooks)
2015-02-20 13:49:36 +00:00
project.execute_services(@push_data.dup, :tag_push_hooks)
2015-01-11 06:18:14 +00:00
true
end
private
def create_push_data(oldrev, newrev, ref)
Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
end
end