[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-5-g7f1f228
Jérémy Lal
kapouer at melix.org
Thu Oct 11 10:25:02 UTC 2012
The following commit has been merged in the master-experimental branch:
commit 668235a2749e82065fdea4db7a53b227e87f7986
Author: Jérémy Lal <kapouer at melix.org>
Date: Tue Jul 5 22:08:18 2011 +0200
Output a message and exit with an error if rake db:migrate fails.
diff --git a/debian/postinst b/debian/postinst
index 9b05cbe..d6a34da 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -242,16 +242,22 @@ for lInstance in $gInstances; do
# handle rake install
echo "Populating database for redmine instance \"${lInstance}\".
This may take a while."
- rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
- echo "Done."
- if [ $lInstall -eq 1 ]; then
- rake -s redmine:load_default_data RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" REDMINE_LANG=$DEFAULT_LANGUAGE || true
- # because rake task is executed as root here, and this file is used later by web server, make sure owner is www-data
- touch ${fRailsLog}/production.log
- chown -f www-data:www-data ${fRailsLog}/production.log
+ fCode=0
+ rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+ if [ $fCode -eq 0 ]; then
+ echo "Done."
+ if [ $lInstall -eq 1 ]; then
+ rake -s redmine:load_default_data RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" REDMINE_LANG=$DEFAULT_LANGUAGE || true
+ # because rake task is executed as root here, and this file is used later by web server, make sure owner is www-data
+ touch ${fRailsLog}/production.log
+ chown -f www-data:www-data ${fRailsLog}/production.log
+ fi
+ # handle plugins migration
+ rake -s db:migrate_plugins RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
+ else
+ echo "Error when running rake db:migrate, check database configuration."
+ exit -1
fi
- # handle plugins migration
- rake -s db:migrate_plugins RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
else
echo "Redmine instance \"${lInstance}\" database must be configured manually."
fi
--
redmine.git
More information about the Pkg-ruby-extras-commits
mailing list