debian-mirror-gitlab/debian/rake-tasks.sh

40 lines
1.1 KiB
Bash
Raw Normal View History

2015-09-12 15:42:12 +05:30
#! /bin/sh
# Read configuration values
2015-10-24 12:51:45 +05:30
. /etc/gitlab/gitlab-debian.conf
2015-09-12 15:42:12 +05:30
# export DB for su
export DB=${DB}
2015-09-12 15:42:12 +05:30
echo "Initializing database..."
2015-11-09 19:02:10 +05:30
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:setup RAILS_ENV=production force=yes'
2016-01-15 23:43:54 +05:30
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:shell:install \
REDIS_URL=redis://localhost:6379 \
2015-11-10 20:57:56 +05:30
SHELL_ROOT_PATH=/usr/share/gitlab-shell RAILS_ENV=production'
2015-09-12 15:42:12 +05:30
echo "Precompiling assets..."
2015-11-09 00:12:39 +05:30
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake assets:precompile RAILS_ENV=production'
2016-01-23 23:02:18 +05:30
# Start gitlab
if grep systemd /proc/cmdline
then
systemctl start gitlab.target
else
invoke-rc.d gitlab start
fi
2016-01-23 23:02:18 +05:30
2016-02-09 20:51:38 +05:30
# Workaround for #813770
if [ "${GITLAB_HTTPS}" = "true" ]; then
gl_proto="https"
sed -i "s/#port: 80/port: 443/" ${gitlab_home}/config/gitlab.yml
sed -i "s/https: false/https: true/" ${gitlab_home}/config/gitlab.yml
else
gl_proto="http"
fi
sed -i \
"s/gitlab_url: http:\/\/localhost/gitlab_url: ${gl_proto}:\/\/${GITLAB_HOST}/"\
2016-02-09 21:45:06 +05:30
${gitlab_shell_root}/config.yml
2016-02-09 20:51:38 +05:30
2016-01-23 23:02:18 +05:30
# Check gitlab is configured correctly
2016-01-16 02:16:50 +05:30
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
2015-09-12 15:42:12 +05:30