debian-mirror-gitlab/debian/rake-tasks.sh
2016-02-04 15:33:53 +05:30

26 lines
769 B
Bash
Executable file

#! /bin/sh
# Read configuration values
. /etc/gitlab/gitlab-debian.conf
# export DB for su
export DB=${DB}
echo "Initializing database..."
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:setup RAILS_ENV=production force=yes'
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:shell:install \
REDIS_URL=redis://localhost:6379 \
SHELL_ROOT_PATH=/usr/share/gitlab-shell RAILS_ENV=production'
echo "Precompiling assets..."
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake assets:precompile RAILS_ENV=production'
# Start gitlab
if grep systemd /proc/cmdline
then
systemctl start gitlab.target
else
invoke-rc.d gitlab start
fi
# Check gitlab is configured correctly
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'