remove export from gitlab-debian.conf for systemd

- so we can use it as EnvironmentFile in systemd services
This commit is contained in:
Praveen Arimbrathodiyil 2016-02-04 13:31:45 +05:30
parent 8631f0349d
commit 83e4782137
4 changed files with 24 additions and 19 deletions

6
debian/conf/gitlab vendored
View file

@ -7,12 +7,12 @@
# Normal values are "production", "test" and "development".
RAILS_ENV="production"
# Database selection
export DB="postgres"
# Read debian specific configuration
. /etc/gitlab/gitlab-debian.conf
# DB needs to be exported for some commands
export DB=${DB}
# app_user defines the user that GitLab is run as.
# The default is "git".
app_user=${gitlab_user}

View file

@ -1,12 +1,12 @@
export RAILS_ENV=production
export DB=postgres
export gitlab_user=gitlab
export gitlab_conf=/etc/gitlab.conf
export gitlab_home=/usr/share/gitlab
export gitlab_data_dir=/var/lib/gitlab
export gitlab_scripts=/usr/lib/gitlab/scripts
export gitlab_nginx_log=/var/log/gitlab
export gitlab_ssl_path=/etc/gitlab/ssl
export gitlab_shell_root=/usr/share/gitlab-shell
export gitlab_shell_log=/var/log/gitlab-shell
export nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example
RAILS_ENV=production
DB=postgres
gitlab_user=gitlab
gitlab_conf=/etc/gitlab.conf
gitlab_home=/usr/share/gitlab
gitlab_data_dir=/var/lib/gitlab
gitlab_scripts=/usr/lib/gitlab/scripts
gitlab_nginx_log=/var/log/gitlab
gitlab_ssl_path=/etc/gitlab/ssl
gitlab_shell_root=/usr/share/gitlab-shell
gitlab_shell_log=/var/log/gitlab-shell
nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example

10
debian/postinst vendored
View file

@ -33,6 +33,8 @@ case "$1" in
gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf
. ${gitlab_debian_conf}
# export DB for su command
export DB=${DB}
. /usr/lib/gitlab/scripts/adduser.sh
gitlab_repo_path=${gitlab_data_dir}/repositories
mkdir -p ${gitlab_repo_path}
@ -52,10 +54,10 @@ case "$1" in
if [ "${RET}" != "" ]; then
if ! grep GITLAB_HOST ${gitlab_debian_conf}
then
echo export GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
echo export GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
echo export GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
echo export GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
echo GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
fi
if test -f ${nginx_conf_example}

View file

@ -2,6 +2,9 @@
# 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 \