diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index dd45b2a..4ebb25a 100644 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -35,9 +35,12 @@ if [ "$1" = 'zammad-railsserver' ]; then mount_nfs # db mirgrate + set +e bundle exec rake db:migrate &> /dev/null + DB_CHECK="$?" + set -e - if [ $? != 0 ]; then + if [ "${DB_CHECK}" != "0" ]; then echo "creating db & searchindex..." bundle exec rake db:create bundle exec rake db:migrate