move gitlab check to its own script

This commit is contained in:
Praveen Arimbrathodiyil 2016-10-01 16:02:34 +05:30
parent b0baf69655
commit d6bd3b07be
4 changed files with 15 additions and 14 deletions

13
debian/gitlab-check.sh vendored Executable file
View file

@ -0,0 +1,13 @@
#! /bin/sh
set -e
# Read and export debian specific configuration
# Only exported variables will be passed on to gitlab app
export $(cat /etc/gitlab/gitlab-debian.conf)
cd /usr/share/gitlab
# Check gitlab is configured correctly
printf "Check if Gitlab is configured correctly...\n"
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'

1
debian/install vendored
View file

@ -10,6 +10,7 @@ debian/conf/tmpfiles.d/gitlab.conf usr/lib/tmpfiles.d
debian/adduser.sh usr/lib/gitlab/scripts
debian/grantpriv.sh usr/lib/gitlab/scripts
debian/rake-tasks.sh usr/lib/gitlab/scripts
debian/gitlab-check.sh usr/lib/gitlab/scripts
app usr/share/gitlab
bin usr/share/gitlab
CHANGELOG usr/share/gitlab

2
debian/postinst vendored
View file

@ -240,6 +240,6 @@ esac
case "$1" in
configure)
echo "Running rake checks..."
. /usr/lib/gitlab/scripts/rake-tasks.sh check
. /usr/lib/gitlab/scripts/gitlab-check.sh
;;
esac

13
debian/rake-tasks.sh vendored
View file

@ -7,17 +7,6 @@ set -e
export $(cat /etc/gitlab/gitlab-debian.conf)
cd /usr/share/gitlab
glcheck() {
# Check gitlab is configured correctly
printf "Check if Gitlab is configured correctly...\n"
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
}
if [ "$1" = "check" ]; then
glcheck
exit
fi
# Check if the db is already present
if [ "$(LANG=C su postgres -c "psql gitlab_production -c \"\d\"")" = \
"No relations found." ]; then
@ -37,5 +26,3 @@ chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
echo "Precompiling assets..."
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
glcheck