2012-05-26 10:37:49 +00:00
|
|
|
module Gitlab
|
2011-12-03 23:44:59 +00:00
|
|
|
class Gitolite
|
|
|
|
class AccessDenied < StandardError; end
|
2012-09-07 05:16:29 +00:00
|
|
|
|
|
|
|
def config
|
2012-09-07 12:36:40 +00:00
|
|
|
Gitlab::GitoliteConfig.new
|
2012-09-07 05:16:29 +00:00
|
|
|
end
|
2011-12-03 23:44:59 +00:00
|
|
|
|
2013-02-04 12:28:10 +00:00
|
|
|
# Add new key to gitlab-shell
|
2013-01-28 19:02:10 +00:00
|
|
|
#
|
|
|
|
# Ex.
|
2013-02-04 12:28:10 +00:00
|
|
|
# add_key("randx", "sha-rsa ...")
|
2013-01-28 19:02:10 +00:00
|
|
|
#
|
2013-02-04 12:28:10 +00:00
|
|
|
def add_key(username, key_content)
|
|
|
|
# TODO: implement
|
2012-08-28 21:04:06 +00:00
|
|
|
end
|
|
|
|
|
2013-02-04 12:28:10 +00:00
|
|
|
# Remove ssh key from gitlab shell
|
2013-01-28 15:39:02 +00:00
|
|
|
#
|
|
|
|
# Ex.
|
2013-02-04 12:28:10 +00:00
|
|
|
# remove_key("sha-rsa")
|
2013-01-28 15:39:02 +00:00
|
|
|
#
|
2013-02-04 12:28:10 +00:00
|
|
|
def remove_key(key_content)
|
|
|
|
# TODO: implement
|
2012-11-21 05:54:05 +00:00
|
|
|
end
|
|
|
|
|
2013-02-04 12:28:10 +00:00
|
|
|
# Remove repository from file system
|
2013-01-28 15:22:45 +00:00
|
|
|
#
|
|
|
|
# name - project path with namespace
|
|
|
|
#
|
|
|
|
# Ex.
|
|
|
|
# remove_repository("gitlab/gitlab-ci")
|
|
|
|
#
|
|
|
|
def remove_repository(name)
|
2013-02-04 12:28:10 +00:00
|
|
|
# TODO: implement
|
2012-03-05 22:26:40 +00:00
|
|
|
end
|
|
|
|
|
2013-02-04 12:28:10 +00:00
|
|
|
# Init new repository
|
|
|
|
#
|
|
|
|
# name - project path with namespace
|
2013-01-28 15:39:02 +00:00
|
|
|
#
|
|
|
|
# Ex.
|
2013-02-04 12:28:10 +00:00
|
|
|
# add_repository("gitlab/gitlab-ci")
|
2013-01-28 15:39:02 +00:00
|
|
|
#
|
2013-02-04 12:28:10 +00:00
|
|
|
def add_repository(name)
|
|
|
|
# TODO: implement
|
2013-01-28 15:39:02 +00:00
|
|
|
end
|
|
|
|
|
2012-08-28 21:04:06 +00:00
|
|
|
def url_to_repo path
|
2012-12-15 00:16:25 +00:00
|
|
|
Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git"
|
2012-08-28 21:04:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def enable_automerge
|
2012-09-08 11:24:38 +00:00
|
|
|
config.admin_all_repo!
|
2012-03-30 05:25:04 +00:00
|
|
|
end
|
2011-12-03 23:44:59 +00:00
|
|
|
end
|
|
|
|
end
|