OSDN Git Service

add import repo gitlab_shell call
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 11 Feb 2013 17:41:02 +0000 (19:41 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 11 Feb 2013 17:41:02 +0000 (19:41 +0200)
lib/gitlab/backend/shell.rb

index a779e88..85fa5bd 100644 (file)
@@ -13,6 +13,17 @@ module Gitlab
       system("/home/git/gitlab-shell/bin/gitlab-projects add-project #{name}.git")
     end
 
+    # Import repository
+    #
+    # name - project path with namespace
+    #
+    # Ex.
+    #   import_repository("gitlab/gitlab-ci", "https://github.com/randx/six.git")
+    #
+    def import_repository(name, url)
+      system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{name}.git #{url}")
+    end
+
     # Remove repository from file system
     #
     # name - project path with namespace