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
a7304fe0
Commit
a7304fe0
authored
Feb 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix truncate repos. Added path option to import
parent
918068df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
README.md
README.md
+1
-1
bin/gitlab-projects
bin/gitlab-projects
+2
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+2
-2
support/truncate_repositories.sh
support/truncate_repositories.sh
+1
-1
No files found.
README.md
View file @
a7304fe0
...
...
@@ -25,7 +25,7 @@ Remove repo
Import repo
./bin/gitlab-projects import-project https://github.com/randx/six.git
./bin/gitlab-projects import-project
randx/six.git
https://github.com/randx/six.git
### Keys:
...
...
bin/gitlab-projects
View file @
a7304fe0
...
...
@@ -11,6 +11,8 @@ require_relative '../lib/gitlab_init'
#
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
#
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
#
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_projects'
)
GitlabProjects
.
new
.
exec
...
...
lib/gitlab_projects.rb
View file @
a7304fe0
...
...
@@ -41,8 +41,8 @@ class GitlabProjects
end
def
import_project
dir
=
@project_name
.
match
(
/[a-zA-Z\.\_\-]+\.git$/
).
to_s
cmd
=
"cd
#{
@repos_path
}
&& git clone --bare
#{
@
project_name
}
#{
dir
}
&&
#{
create_hooks_cmd
}
"
@source
=
ARGV
.
shift
cmd
=
"cd
#{
@repos_path
}
&& git clone --bare
#{
@
source
}
#{
@project_name
}
&&
#{
create_hooks_cmd
}
"
system
(
cmd
)
end
end
support/truncate_repositories.sh
View file @
a7304fe0
...
...
@@ -6,7 +6,7 @@ echo "Danger!!! Data Loss"
while
true
;
do
read
-p
"Do you wish to delete all directories (except gitolite-admin.git) from
$home_dir
/repositories/ (y/n) ?: "
yn
case
$yn
in
[
Yy]
*
)
sh
-c
"find
$home_dir
/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs
sudo
rm -rf"
;
break
;;
[
Yy]
*
)
sh
-c
"find
$home_dir
/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"
;
break
;;
[
Nn]
*
)
exit
;;
*
)
echo
"Please answer yes or no."
;;
esac
...
...
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