Commit 0ae5f345 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Do not run check_upgrade upon "start"

Automatically upgrading the instance with --backup-db=no is not
desirable for anyone who cares about their data. Now that we have an
"upgrade" command, people should run this directly. Accordingly, we drop
the "check" part of upgrade.
parent 4ff87e44fd98
......@@ -16,25 +16,18 @@ import jinja2
print(jinja2.Template(open('/pyramid.ini.j2').read()).render(os.environ))
EOF
fi
check_upgrade() {
echo "check the instance is properly bootstraped and up to date"
echo "print('OK')" > /tmp/chk.py
isok=$(cubicweb-ctl shell $CW_INSTANCE /tmp/chk.py || true)
if [ "x$isok" != xOK ]; then
echo $isok
echo "upgrading instance"
cubicweb-ctl upgrade --backup-db=no --force --verbosity=0 $CW_INSTANCE
fi
upgrade() {
echo "upgrading instance"
cubicweb-ctl upgrade --backup-db=no --force --verbosity=0 $CW_INSTANCE
cubicweb-ctl gen-static-datadir $CW_INSTANCE
cubicweb-ctl i18ninstance $CW_INSTANCE
}
case "$1" in
start)
check_upgrade
exec uwsgi --ini /etc/uwsgi/uwsgi.ini
;;
upgrade)
check_upgrade
upgrade
;;
db-create)
exec cubicweb-ctl db-create --automatic $CW_INSTANCE
......
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