Class: Projects::ImportService

Inherits:
BaseService show all
Includes:
Gitlab::ShellAdapter
Defined in:
app/services/projects/import_service.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

ALLOWED_TYPES =
[
  'bitbucket',
  'fogbugz',
  'gitlab',
  'github',
  'google_code'
]

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from Gitlab::ShellAdapter

#gitlab_shell

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 Method Details

#executeObject


15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/services/projects/import_service.rb', line 15

def execute
  if unknown_url?
    # In this case, we only want to import issues, not a repository.
    create_repository
  else
    import_repository
  end

  import_data

  success
rescue Error => e
  error(e.message)
end