Class: GitTagPushService

Inherits:
BaseService show all
Defined in:
app/services/git_tag_push_service.rb

Instance Attribute Summary collapse

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#abilities, #can?, #deny_visibility_level, #event_service, #initialize, #log_info, #notification_service, #repository, #system_hook_service, #todo_service

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Constructor Details

This class inherits a constructor from BaseService

Instance Attribute Details

#push_dataObject

Returns the value of attribute push_data


2
3
4
# File 'app/services/git_tag_push_service.rb', line 2

def push_data
  @push_data
end

Instance Method Details

#executeObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/services/git_tag_push_service.rb', line 4

def execute
  project.repository.after_create if project.empty_repo?
  project.repository.before_push_tag

  @push_data = build_push_data

  EventCreateService.new.push(project, current_user, @push_data)
  SystemHooksService.new.execute_hooks(build_system_push_data.dup, :tag_push_hooks)
  project.execute_hooks(@push_data.dup, :tag_push_hooks)
  project.execute_services(@push_data.dup, :tag_push_hooks)
  CreateCommitBuildsService.new.execute(project, current_user, @push_data)
  ProjectCacheWorker.perform_async(project.id)

  true
end