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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
87e2d6e9
Commit
87e2d6e9
authored
Feb 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from zzet/feature/fix_install_script
Simple changes in commands
parents
491d3cee
3278adf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
bin/install
bin/install
+8
-5
support/rewrite-hooks.sh
support/rewrite-hooks.sh
+6
-5
support/truncate_repositories.sh
support/truncate_repositories.sh
+4
-2
No files found.
bin/install
View file @
87e2d6e9
...
...
@@ -6,12 +6,15 @@ require_relative '../lib/gitlab_init'
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
config
=
GitlabConfig
.
new
key_dir
=
config
.
auth_file
.
delete
"authorized_keys"
commands
=
[
"mkdir -p
/home/git/repositories
"
,
"mkdir -p
/home/git/.ssh
"
,
"touch
/home/git/.ssh/authorized_keys
"
,
"chmod -R ug+rwX,o-rwx
/home/git/repositories/
"
,
"find
/home/git/repositories
-type d -print0 | xargs -0 chmod g+s"
"mkdir -p
#{
config
.
repos_path
}
"
,
"mkdir -p
#{
key_dir
}
"
,
"touch
#{
config
.
auth_file
}
"
,
"chmod -R ug+rwX,o-rwx
#{
config
.
repos_path
}
"
,
"find
#{
config
.
repos_path
}
-type d -print0 | xargs -0 chmod g+s"
]
commands
.
each
do
|
cmd
|
...
...
support/rewrite-hooks.sh
View file @
87e2d6e9
#!/bin/bash
src
=
"/home/git/repositories"
home_dir
=
"/home/git"
src
=
"
$home_dir
/repositories"
for
dir
in
`
ls
"
$src
/"
`
do
...
...
@@ -14,22 +15,22 @@ do
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
then
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
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
else
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
do
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
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
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
fi
done
...
...
support/truncate_repositories.sh
View file @
87e2d6e9
#!/bin/bash
home_dir
=
"/home/git"
echo
"Danger!!! Data Loss"
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
[
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
;;
*
)
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