archives/gitlab-shell: new aport
This commit is contained in:
parent
f690124a2f
commit
9f6c072b60
6 changed files with 270 additions and 0 deletions
41
archives/gitlab-shell/gitlab-shell.pre-install
Normal file
41
archives/gitlab-shell/gitlab-shell.pre-install
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
# It's very important to set user/group correctly.
|
||||
|
||||
git_dir='/var/lib/gitlab'
|
||||
|
||||
if ! getent group git >/dev/null; then
|
||||
echo '* Creating group git' >&2
|
||||
|
||||
addgroup -S git
|
||||
fi
|
||||
|
||||
if ! id git 2>/dev/null 1>&2; then
|
||||
echo '* Creating user git' >&2
|
||||
|
||||
adduser -DHS -G git -h "$git_dir" -s /bin/sh \
|
||||
-g "added by apk for gitlab-shell" git
|
||||
passwd -u git >/dev/null # unlock
|
||||
fi
|
||||
|
||||
if ! id -Gn git | grep -Fq redis; then
|
||||
echo '* Adding user git to group redis' >&2
|
||||
|
||||
addgroup git redis
|
||||
fi
|
||||
|
||||
user_home="$(getent passwd git | cut -d: -f6)"
|
||||
|
||||
if [ "$user_home" != "$git_dir" ]; then
|
||||
cat >&2 <<-EOF
|
||||
!!
|
||||
!! User git has home directory in $user_home, but this package and gitlab-ce
|
||||
!! package assumes $git_dir. Although it's possible to use a different
|
||||
!! directory, it's really not easy.
|
||||
!!
|
||||
!! Please change git's home directory to $git_dir, or adjust settings
|
||||
!! and move files yourself. Otherwise GitLab will not work!
|
||||
!!
|
||||
EOF
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue