[DRE-commits] [gitlab] 01/13: remove export from gitlab-debian.conf for systemd

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Thu Feb 4 11:02:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit 83e478213741cde547d16fa3a92b31bfe308998f
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Feb 4 13:31:45 2016 +0530

    remove export from gitlab-debian.conf for systemd
    
    - so we can use it as EnvironmentFile in systemd services
---
 debian/conf/gitlab             |  6 +++---
 debian/conf/gitlab-debian.conf | 24 ++++++++++++------------
 debian/postinst                | 10 ++++++----
 debian/rake-tasks.sh           |  3 +++
 4 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/debian/conf/gitlab b/debian/conf/gitlab
index 7762273..c9a4fa2 100755
--- a/debian/conf/gitlab
+++ b/debian/conf/gitlab
@@ -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}
diff --git a/debian/conf/gitlab-debian.conf b/debian/conf/gitlab-debian.conf
index 2876752..2e0e421 100644
--- a/debian/conf/gitlab-debian.conf
+++ b/debian/conf/gitlab-debian.conf
@@ -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
diff --git a/debian/postinst b/debian/postinst
index d8f4371..383cdf4 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -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}
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
index e17090b..12ec416 100755
--- a/debian/rake-tasks.sh
+++ b/debian/rake-tasks.sh
@@ -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 \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git



More information about the Pkg-ruby-extras-commits mailing list