[DRE-commits] [gitlab] 09/10: move gitlab check to its own script

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sat Oct 1 12:47:19 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 d6bd3b07bec21417e6aa9df319f000fc82d09773
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sat Oct 1 16:02:34 2016 +0530

    move gitlab check to its own script
---
 debian/gitlab-check.sh | 13 +++++++++++++
 debian/install         |  1 +
 debian/postinst        |  2 +-
 debian/rake-tasks.sh   | 13 -------------
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/debian/gitlab-check.sh b/debian/gitlab-check.sh
new file mode 100755
index 0000000..b8b85af
--- /dev/null
+++ b/debian/gitlab-check.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+set -e
+
+# Read and export debian specific configuration
+# Only exported variables will be passed on to gitlab app
+export $(cat /etc/gitlab/gitlab-debian.conf)
+cd /usr/share/gitlab
+
+# Check gitlab is configured correctly
+printf "Check if Gitlab is configured correctly...\n"
+su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
+
diff --git a/debian/install b/debian/install
index d2d2123..4179b5e 100644
--- a/debian/install
+++ b/debian/install
@@ -10,6 +10,7 @@ debian/conf/tmpfiles.d/gitlab.conf usr/lib/tmpfiles.d
 debian/adduser.sh usr/lib/gitlab/scripts
 debian/grantpriv.sh usr/lib/gitlab/scripts
 debian/rake-tasks.sh usr/lib/gitlab/scripts
+debian/gitlab-check.sh usr/lib/gitlab/scripts
 app usr/share/gitlab
 bin usr/share/gitlab
 CHANGELOG usr/share/gitlab
diff --git a/debian/postinst b/debian/postinst
index 800a18e..5d94f71 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -240,6 +240,6 @@ esac
 case "$1" in
   configure)
     echo "Running rake checks..."
-    . /usr/lib/gitlab/scripts/rake-tasks.sh check
+    . /usr/lib/gitlab/scripts/gitlab-check.sh
   ;;
 esac
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
index 357cd9a..96982bf 100755
--- a/debian/rake-tasks.sh
+++ b/debian/rake-tasks.sh
@@ -7,17 +7,6 @@ set -e
 export $(cat /etc/gitlab/gitlab-debian.conf)
 cd /usr/share/gitlab
 
-glcheck() {
-    # Check gitlab is configured correctly
-    printf "Check if Gitlab is configured correctly...\n"
-    su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
-}
-
-if [ "$1" = "check" ]; then
-    glcheck
-    exit
-fi
-
 # Check if the db is already present
 if [ "$(LANG=C su postgres -c "psql gitlab_production -c \"\d\"")" = \
 "No relations found." ]; then
@@ -37,5 +26,3 @@ chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
 
 echo "Precompiling assets..."
 su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
-
-glcheck

-- 
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