Commit 1c689ec2 authored by Lucas Kanashiro's avatar Lucas Kanashiro

Update debian/rake-tasks.sh migration task

Restart all the obs-api related services after migrating the database.
parent 2b17811f
......@@ -18,8 +18,10 @@ open-build-service (2.9.4-3) UNRELEASED; urgency=medium
[ Lucas Kanashiro ]
* debian/NEWS: add new entry to notify users to check the default Passenger
user when upgrading.
* debian/rake-tasks.sh: update migration task to restart all OBS related
services.
-- Lucas Kanashiro <kanashiro@debian.org> Tue, 09 Apr 2019 13:54:27 -0300
-- Lucas Kanashiro <kanashiro@debian.org> Tue, 09 Apr 2019 14:18:30 -0300
open-build-service (2.9.4-2) unstable; urgency=medium
......
......@@ -77,12 +77,25 @@ case "$1" in
reload_apache restart
;;
migrate)
# Migrade the database
cd /usr/share/obs/api
RAILS_ENV=production bundle exec rake db:migrate:with_data >> log/db_migrate.log
# Migrate the database
cd /usr/share/obs/api
RAILS_ENV=production bundle exec rake db:migrate:with_data >> log/db_migrate.log
# Restart Apache to really enable the module and load obs.conf
reload_apache restart
# Restart all daemons
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d obsapi-clockwork.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-consistency_check.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-default.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-issuetracking.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-mailers.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-project_log_rotate.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-quick.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-releasetracking.service restart 3>/dev/null || true
echo "obsapi restarted."
fi
# Restart Apache to really enable the module and load obs.conf
reload_apache restart
;;
*)
echo "Usage: $0 {setup|migrate}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment