create db/schema.rb only in postinst

This commit is contained in:
Praveen Arimbrathodiyil 2016-10-01 15:08:03 +05:30
parent acd121d1cc
commit ef145c1ca9
4 changed files with 6 additions and 10 deletions

3
debian/changelog vendored
View file

@ -1,10 +1,11 @@
gitlab (8.12.1+dfsg1-1) UNRELEASED; urgency=medium
* New upstream release
* New upstream release (Closes: #838256)
* Use spec.rake and spec.pattern to select tests
* Use INCLUDE_TEST_DEPENDS variable in Gemfile to select test dependencies
(--without does not work with --local in bundle install)
* Move /usr/share/gitlab/.bundle to /var/lib/gitlab
* Create db/schema.rb only in postinst (Closes: #838668)
[ Dmitry Smirnov ]
* Fix failure to start masked gitlab.service after reinstall

2
debian/gitlab.links vendored
View file

@ -15,7 +15,5 @@ usr/share/javascript/clipboard/clipboard.js usr/share/gitlab/vendor/assets/javas
usr/share/javascript/chartjs/Chart.js usr/share/gitlab/vendor/assets/javascripts/chart-lib.min.js
usr/share/javascript/graphael/g.raphael-min.js usr/share/gitlab/vendor/assets/javascripts/g.raphael-min.js
usr/share/javascript/graphael/g.bar-min.js usr/share/gitlab/vendor/assets/javascripts/g.bar-min.js
/var/lib/gitlab/.secret /usr/share/gitlab/.secret
/var/lib/gitlab/.gitlab_workhorse_secret /usr/share/gitlab/.gitlab_workhorse_secret
/var/lib/gitlab/Gemfile.lock /usr/share/gitlab/Gemfile.lock

10
debian/rake-tasks.sh vendored
View file

@ -18,17 +18,13 @@ if [ "$1" = "check" ]; then
exit
fi
if ! [ -f "${gitlab_app_root}/config/secrets.yml" ]; then
echo "Creating secrets.yml..."
cd ${gitlab_app_root}
su gitlab -c 'bundle exec rake config/initializers/secret_token.rb'
fi
# Check if the db is already present
if [ "$(LANG=C su postgres -c "psql gitlab_production -c \"\d\"")" = \
"No relations found." ]; then
echo "Initializing database..."
test -f ${gitlab_home}/db/schema.rb || \
su ${gitlab_user} -s /bin/sh -c\
"cp ${gitlab_home}/db/schema.rb.template ${gitlab_home}/db/schema.rb"
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake db:schema:load'
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake db:seed_fu'
else

1
debian/rules vendored
View file

@ -10,6 +10,7 @@ override_dh_install:
# Make sure we are installing all required files in debian/install
sh debian/upstream-file-count-check.sh
rm -rf debian/gitlab/usr/share/gitlab/tmp/*
mv debian/gitlab/var/lib/gitlab/db/schema.rb debian/gitlab/var/lib/gitlab/db/schema.rb.template
override_dh_installinit:
dh_installinit --no-start -p gitlab --name=gitlab-sidekiq