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
3278adf1
Commit
3278adf1
authored
Feb 08, 2013
by
Andrey Kumanyaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple DRY (if non-usual installation)
parent
58231f31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
support/rewrite-hooks.sh
support/rewrite-hooks.sh
+6
-5
support/truncate_repositories.sh
support/truncate_repositories.sh
+4
-2
No files found.
support/rewrite-hooks.sh
View file @
3278adf1
#!/bin/bash
#!/bin/bash
src
=
"/home/git/repositories"
home_dir
=
"/home/git"
src
=
"
$home_dir
/repositories"
for
dir
in
`
ls
"
$src
/"
`
for
dir
in
`
ls
"
$src
/"
`
do
do
...
@@ -14,22 +15,22 @@ do
...
@@ -14,22 +15,22 @@ do
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
then
then
project_hook
=
"
$src
/
$dir
/hooks/post-receive"
project_hook
=
"
$src
/
$dir
/hooks/post-receive"
gitolite_hook
=
"
/home/git
/gitlab-shell/hooks/post-receive"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitolite_hook
$project_hook
ln
-s
-f
$gitolite_hook
$project_hook
project_hook
=
"
$src
/
$dir
/hooks/update"
project_hook
=
"
$src
/
$dir
/hooks/update"
gitolite_hook
=
"
/home/git
/gitlab-shell/hooks/update"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitolite_hook
$project_hook
ln
-s
-f
$gitolite_hook
$project_hook
else
else
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
do
do
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/post-receive"
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/post-receive"
gitolite_hook
=
"
/home/git
/gitlab-shell/hooks/post-receive"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitolite_hook
$project_hook
ln
-s
-f
$gitolite_hook
$project_hook
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/update"
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/update"
gitolite_hook
=
"
/home/git
/gitlab-shell/hooks/update"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitolite_hook
$project_hook
ln
-s
-f
$gitolite_hook
$project_hook
fi
fi
done
done
...
...
support/truncate_repositories.sh
View file @
3278adf1
#!/bin/bash
#!/bin/bash
home_dir
=
"/home/git"
echo
"Danger!!! Data Loss"
echo
"Danger!!! Data Loss"
while
true
;
do
while
true
;
do
read
-p
"Do you wish to delete all directories (except gitolite-admin.git) from
/home/git
/repositories/ (y/n) ?: "
yn
read
-p
"Do you wish to delete all directories (except gitolite-admin.git) from
$home_dir
/repositories/ (y/n) ?: "
yn
case
$yn
in
case
$yn
in
[
Yy]
*
)
sh
-c
"find
/home/git
/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 sudo rm -rf"
;
break
;;
[
Nn]
*
)
exit
;;
[
Nn]
*
)
exit
;;
*
)
echo
"Please answer yes or no."
;;
*
)
echo
"Please answer yes or no."
;;
esac
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