Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 17:07:56 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 17:07:56 +0400
commit27d9ac0fe8a33f0e94178c1f46826bc114e16467 (patch)
treeacfb46c9189213045c893dfe7ad35be211e483e0 /lib
parent6b9a60904451fb192e445774768ccb53f7f8d2f8 (diff)
Make gitlab works with gitlab-shell
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/shell.rb (renamed from lib/gitlab/backend/gitolite.rb)47
-rw-r--r--lib/gitolited.rb2
2 files changed, 21 insertions, 28 deletions
diff --git a/lib/gitlab/backend/gitolite.rb b/lib/gitlab/backend/shell.rb
index 62eb500bcd6..7423b106a45 100644
--- a/lib/gitlab/backend/gitolite.rb
+++ b/lib/gitlab/backend/shell.rb
@@ -1,27 +1,16 @@
module Gitlab
- class Gitolite
+ class Shell
class AccessDenied < StandardError; end
- def config
- Gitlab::GitoliteConfig.new
- end
-
- # Add new key to gitlab-shell
- #
- # Ex.
- # add_key("randx", "sha-rsa ...")
+ # Init new repository
#
- def add_key(username, key_content)
- # TODO: implement
- end
-
- # Remove ssh key from gitlab shell
+ # name - project path with namespace
#
# Ex.
- # remove_key("sha-rsa")
+ # add_repository("gitlab/gitlab-ci")
#
- def remove_key(key_content)
- # TODO: implement
+ def add_repository(name)
+ system("/home/git/gitlab-shell/bin/gitlab-projects add-project #{name}.git")
end
# Remove repository from file system
@@ -32,26 +21,30 @@ module Gitlab
# remove_repository("gitlab/gitlab-ci")
#
def remove_repository(name)
- # TODO: implement
+ system("/home/git/gitlab-shell/bin/gitlab-projects rm-project #{name}.git")
end
- # Init new repository
+ # Add new key to gitlab-shell
#
- # name - project path with namespace
+ # Ex.
+ # add_key("randx", "sha-rsa ...")
+ #
+ def add_key(username, key_content)
+ system("/home/git/gitlab-shell/bin/gitlab-keys add-key #{username} \"#{key_content}\"")
+ end
+
+ # Remove ssh key from gitlab shell
#
# Ex.
- # add_repository("gitlab/gitlab-ci")
+ # remove_key("sha-rsa")
#
- def add_repository(name)
- # TODO: implement
+ def remove_key(key_content)
+ system("/home/git/gitlab-shell/bin/gitlab-keys rm-key \"#{key_content}\"")
end
+
def url_to_repo path
Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git"
end
-
- def enable_automerge
- config.admin_all_repo!
- end
end
end
diff --git a/lib/gitolited.rb b/lib/gitolited.rb
index 68b9b625525..4911a473f05 100644
--- a/lib/gitolited.rb
+++ b/lib/gitolited.rb
@@ -6,6 +6,6 @@
#
module Gitolited
def gitolite
- Gitlab::Gitolite.new
+ Gitlab::Shell.new
end
end