#!/bin/sh
set -ev

# Start service containers
spoc-container start odoo-postgres

# Run database migration
spoc-container start odoo -- /srv/odoo/odoo-bin -c /srv/odoo/odoo.conf -u all
until grep -q 'odoo.modules.loading: Modules loaded.' /var/log/spoc/odoo.log; do
    sleep 1
done
spoc-container stop odoo

# Disable database migrations
spoc-container stop odoo-postgres
