foreman-packaging/debian/trusty/foreman/foreman-sqlite3.postinst @ 7e2ca313
7e2ca313 | Greg Sutcliffe | #!/bin/sh
|
|
# postinst script for foreman-sqlite3
|
|||
#
|
|||
# see: dh_installdeb(1)
|
|||
if [ ! -z "${DEBUG}" ]; then
|
|||
set -x
|
|||
else
|
|||
set -e
|
|||
fi
|
|||
. /usr/share/debconf/confmodule
|
|||
LOGFILE='/var/log/foreman-install.log'
|
|||
# if this script aborts with an error dpkg can
|
|||
# hang if daemons have been started
|
|||
trap db_stop EXIT
|
|||
# Update gems
|
|||
cd /usr/share/foreman
|
|||
if [ ! -z "${DEBUG}" ]; then
|
|||
bundle update --local
|
|||
else
|
|||
bundle update --local 2>&1 >> $LOGFILE
|
|||
fi
|
|||
# Run a db:migrate and db:seed if the user has created a dbfile
|
|||
if [ -f /usr/share/foreman/config/database.yml ]; then
|
|||
if [ ! -z "${DEBUG}" ]; then
|
|||
/usr/sbin/foreman-rake db:migrate || true
|
|||
/usr/sbin/foreman-rake db:seed || true
|
|||
else
|
|||
/usr/sbin/foreman-rake db:migrate >> $LOGFILE 2>&1 || true
|
|||
/usr/sbin/foreman-rake db:seed >> $LOGFILE 2>&1 || true
|
|||
fi
|
|||
fi
|
|||
# Own all the core files
|
|||
chown -Rf foreman:foreman '/usr/share/foreman'
|
|||
#DEBHELPER#
|
|||
exit 0
|