Class: Gitlab::BitbucketServerImport::ProjectCreator
- Inherits:
-
Object
- Object
- Gitlab::BitbucketServerImport::ProjectCreator
- Defined in:
- lib/gitlab/bitbucket_server_import/project_creator.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#project_key ⇒ Object
readonly
Returns the value of attribute project_key.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#repo_slug ⇒ Object
readonly
Returns the value of attribute repo_slug.
-
#session_data ⇒ Object
readonly
Returns the value of attribute session_data.
-
#timeout_strategy ⇒ Object
readonly
Returns the value of attribute timeout_strategy.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project_key, repo_slug, repo, name, namespace, current_user, session_data, timeout_strategy) ⇒ ProjectCreator
constructor
A new instance of ProjectCreator.
Constructor Details
#initialize(project_key, repo_slug, repo, name, namespace, current_user, session_data, timeout_strategy) ⇒ ProjectCreator
Returns a new instance of ProjectCreator.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 8 def initialize(project_key, repo_slug, repo, name, namespace, current_user, session_data, timeout_strategy) @project_key = project_key @repo_slug = repo_slug @repo = repo @name = name @namespace = namespace @current_user = current_user @session_data = session_data @timeout_strategy = timeout_strategy end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def current_user @current_user end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def namespace @namespace end |
#project_key ⇒ Object (readonly)
Returns the value of attribute project_key.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def project_key @project_key end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def repo @repo end |
#repo_slug ⇒ Object (readonly)
Returns the value of attribute repo_slug.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def repo_slug @repo_slug end |
#session_data ⇒ Object (readonly)
Returns the value of attribute session_data.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def session_data @session_data end |
#timeout_strategy ⇒ Object (readonly)
Returns the value of attribute timeout_strategy.
6 7 8 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 6 def timeout_strategy @timeout_strategy end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gitlab/bitbucket_server_import/project_creator.rb', line 19 def execute ::Projects::CreateService.new( current_user, name: name, path: repo_slug, description: repo.description, namespace_id: namespace.id, visibility_level: repo.visibility_level, import_type: 'bitbucket_server', import_source: repo.browse_url, import_url: repo.clone_url, import_data: { credentials: session_data, data: { project_key: project_key, repo_slug: repo_slug, timeout_strategy: timeout_strategy } }, skip_wiki: true ).execute end |