move gitlab check to its own script
This commit is contained in:
parent
b0baf69655
commit
d6bd3b07be
4 changed files with 15 additions and 14 deletions
13
debian/gitlab-check.sh
vendored
Executable file
13
debian/gitlab-check.sh
vendored
Executable 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
1
debian/install
vendored
|
@ -10,6 +10,7 @@ debian/conf/tmpfiles.d/gitlab.conf usr/lib/tmpfiles.d
|
||||||
debian/adduser.sh usr/lib/gitlab/scripts
|
debian/adduser.sh usr/lib/gitlab/scripts
|
||||||
debian/grantpriv.sh usr/lib/gitlab/scripts
|
debian/grantpriv.sh usr/lib/gitlab/scripts
|
||||||
debian/rake-tasks.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
|
app usr/share/gitlab
|
||||||
bin usr/share/gitlab
|
bin usr/share/gitlab
|
||||||
CHANGELOG usr/share/gitlab
|
CHANGELOG usr/share/gitlab
|
||||||
|
|
2
debian/postinst
vendored
2
debian/postinst
vendored
|
@ -240,6 +240,6 @@ esac
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
echo "Running rake checks..."
|
echo "Running rake checks..."
|
||||||
. /usr/lib/gitlab/scripts/rake-tasks.sh check
|
. /usr/lib/gitlab/scripts/gitlab-check.sh
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
13
debian/rake-tasks.sh
vendored
13
debian/rake-tasks.sh
vendored
|
@ -7,17 +7,6 @@ set -e
|
||||||
export $(cat /etc/gitlab/gitlab-debian.conf)
|
export $(cat /etc/gitlab/gitlab-debian.conf)
|
||||||
cd /usr/share/gitlab
|
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
|
# Check if the db is already present
|
||||||
if [ "$(LANG=C su postgres -c "psql gitlab_production -c \"\d\"")" = \
|
if [ "$(LANG=C su postgres -c "psql gitlab_production -c \"\d\"")" = \
|
||||||
"No relations found." ]; then
|
"No relations found." ]; then
|
||||||
|
@ -37,5 +26,3 @@ chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
|
||||||
|
|
||||||
echo "Precompiling assets..."
|
echo "Precompiling assets..."
|
||||||
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
|
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
|
||||||
|
|
||||||
glcheck
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue