Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
96454ac5
Commit
96454ac5
authored
Feb 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import-project feature
parent
25f4a829
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
README.md
README.md
+9
-4
VERSION
VERSION
+1
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+7
-0
No files found.
README.md
View file @
96454ac5
...
@@ -17,20 +17,25 @@
...
@@ -17,20 +17,25 @@
Add repo
Add repo
./bin/gitlab-projects add-project gitlab/gitlab-ci.git
./bin/gitlab-projects add-project gitlab/gitlab-ci.git
Remove repo
Remove repo
./bin/gitlab-projects rm-project gitlab/gitlab-ci.git
./bin/gitlab-projects rm-project gitlab/gitlab-ci.git
Import repo
./bin/gitlab-projects import-project https://github.com/randx/six.git
### Keys:
### Keys:
Add key
Add key
./bin/gitlab-keys add-key key-782 "ssh-rsa AAAAx321..."
./bin/gitlab-keys add-key key-782 "ssh-rsa AAAAx321..."
Remove key
Remove key
./bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
./bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
VERSION
0 → 100644
View file @
96454ac5
1.0.0
lib/gitlab_projects.rb
View file @
96454ac5
...
@@ -17,6 +17,7 @@ class GitlabProjects
...
@@ -17,6 +17,7 @@ class GitlabProjects
case
@command
case
@command
when
'add-project'
;
add_project
when
'add-project'
;
add_project
when
'rm-project'
;
rm_project
when
'rm-project'
;
rm_project
when
'import-project'
;
import_project
else
else
puts
'not allowed'
puts
'not allowed'
end
end
...
@@ -33,4 +34,10 @@ class GitlabProjects
...
@@ -33,4 +34,10 @@ class GitlabProjects
def
rm_project
def
rm_project
FileUtils
.
rm_rf
(
full_path
)
FileUtils
.
rm_rf
(
full_path
)
end
end
def
import_project
dir
=
@project_name
.
match
(
/[a-zA-Z\.\_\-]+\.git$/
).
to_s
cmd
=
"cd
#{
@repos_path
}
&& git clone --bare
#{
@project_name
}
#{
dir
}
&& ln -s
#{
@hook_path
}
#{
@repos_path
}
/
#{
dir
}
/hooks/post-receive"
system
(
cmd
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment