[DRE-commits] [gitlab] 01/05: Fix first time installation issues

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Tue Dec 12 20:01:22 UTC 2017


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

praveen pushed a commit to branch master
in repository gitlab.

commit 7c5d6cd0dd20c986a0600f08ef8c8a03fd6f76d7
Author: Pirate Praveen <praveen at debian.org>
Date:   Wed Dec 13 00:51:58 2017 +0530

    Fix first time installation issues
---
 debian/gitlab.links  |  1 +
 debian/rake-tasks.sh | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debian/gitlab.links b/debian/gitlab.links
index 1e8b3c2..8f01ef5 100644
--- a/debian/gitlab.links
+++ b/debian/gitlab.links
@@ -24,4 +24,5 @@ usr/share/javascript/graphael/g.raphael-min.js usr/share/gitlab/vendor/assets/ja
 usr/share/javascript/graphael/g.bar-min.js usr/share/gitlab/vendor/assets/javascripts/g.bar-min.js
 usr/share/javascript/fuzzaldrin/fuzzaldrin-plus.js usr/share/gitlab/vendor/assets/javascripts/fuzzaldrin-plus.js
 /var/lib/gitlab/.gitlab_workhorse_secret    /usr/share/gitlab/.gitlab_workhorse_secret
+/var/lib/gitlab/.gitlab_shell_secret    /usr/share/gitlab/.gitlab_shell_secret
 /var/lib/gitlab/Gemfile.lock    /usr/share/gitlab/Gemfile.lock
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
index 1f2226b..1eb7c32 100755
--- a/debian/rake-tasks.sh
+++ b/debian/rake-tasks.sh
@@ -9,19 +9,21 @@ export DB RAILS_ENV
 cd /usr/share/gitlab
 
 # Check if the db is already present
-if [ "$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"")" = \
-"No relations found." ]; then
+db_relations="$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"" 2>&1)"
+if [ "$db_relations" = "No relations found." ] || \
+  [ "$db_relations" = "Did not find any relations." ]; then
   echo "Initializing database..."
   test -f ${gitlab_home}/db/schema.rb || \
   runuser -u ${gitlab_user} -- sh -c \
   "cp ${gitlab_data_dir}/db/schema.rb.template ${gitlab_data_dir}/db/schema.rb"
+  touch ${gitlab_data_dir}/.gitlab_shell_secret
   runuser -u ${gitlab_user} -- sh -c 'bundle exec rake db:schema:load'
-  runuser -u ${gitlab_user} -- sh -c 'bundle exec rake db:seed_fu'
 else
   echo "gitlab_production database is not empty, skipping gitlab setup"
-  runuser -u ${gitlab_user} -- sh -c 'bundle exec rake db:migrate'
 fi
 
+runuser -u ${gitlab_user} -- sh -c 'bundle exec rake db:migrate'
+
 # Restrict permissions for secret files
 chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
 

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