switch to su

This commit is contained in:
Praveen Arimbrathodiyil 2016-02-13 23:52:29 +05:30
parent bcfcb14820
commit 9e86aa5a1a

View file

@ -4,7 +4,7 @@
export $(cat /etc/gitlab/gitlab-debian.conf|xargs)
echo "Initializing database..."
if [ "$(sudo -u postgres psql gitlab_production -c '\d')" = \
if [ "$(su postgres -c 'psql gitlab_production -c \\d')" = \
"No relations found." ]; then
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:setup \
RAILS_ENV=production force=yes'