Async perform for add/remove team members
This commit is contained in:
parent
1c5876eb7b
commit
8b54b7233e
5 changed files with 35 additions and 11 deletions
|
@ -22,7 +22,12 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
def update_repository project_id
|
||||
# Update project config in gitolite by project id
|
||||
#
|
||||
# Ex.
|
||||
# update_repository(23)
|
||||
#
|
||||
def update_repository(project_id)
|
||||
project = Project.find(project_id)
|
||||
config.update_project!(project)
|
||||
end
|
||||
|
@ -45,6 +50,19 @@ module Gitlab
|
|||
config.destroy_project!(name)
|
||||
end
|
||||
|
||||
# Update projects configs in gitolite by project ids
|
||||
#
|
||||
# Ex.
|
||||
# update_repositories([1, 4, 6])
|
||||
#
|
||||
def update_repositories(project_ids)
|
||||
projects = Project.where(id: project_ids)
|
||||
|
||||
config.apply do |config|
|
||||
config.update_projects(projects)
|
||||
end
|
||||
end
|
||||
|
||||
def url_to_repo path
|
||||
Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git"
|
||||
end
|
||||
|
@ -53,12 +71,6 @@ module Gitlab
|
|||
config.admin_all_repo!
|
||||
end
|
||||
|
||||
def update_repositories projects
|
||||
config.apply do |config|
|
||||
config.update_projects(projects)
|
||||
end
|
||||
end
|
||||
|
||||
alias_method :create_repository, :update_repository
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue