Newer
Older
Dmitriy Zaporozhets
committed
require_relative 'gitolite_config'
class Gitolite
class AccessDenied < StandardError; end
Dmitriy Zaporozhets
committed
def config
Gitlab::GitoliteConfig.new
Dmitriy Zaporozhets
committed
end
def set_key key_id, key_content, projects
Dmitriy Zaporozhets
committed
config.apply do |config|
config.write_key(key_id, key_content)
config.update_projects(projects)
end
end
def remove_key key_id, projects
Dmitriy Zaporozhets
committed
config.apply do |config|
config.rm_key(key_id)
config.update_projects(projects)
end
end
def update_repository project
Dmitriy Zaporozhets
committed
config.update_project!(project.path, project)
Dmitriy Zaporozhets
committed
config.destroy_project!(project)
def url_to_repo path
Gitlab.config.ssh_path + "#{path}.git"
end
def enable_automerge
config.admin_all_repo!
Dmitriy Zaporozhets
committed
def update_repositories projects
config.apply do |config|
config.update_projects(projects)
end
end
Dmitriy Zaporozhets
committed
alias_method :create_repository, :update_repository