fix(hoot-dom): include hoot module loader + version-aware shim upgrade
This commit is contained in:
@@ -5,7 +5,7 @@ description: |
|
|||||||
Variation between instances is expressed via values.yaml only.
|
Variation between instances is expressed via values.yaml only.
|
||||||
No chart variants. No string-templating in Tower.
|
No chart variants. No string-templating in Tower.
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.2
|
version: 0.1.3
|
||||||
appVersion: "1.0"
|
appVersion: "1.0"
|
||||||
keywords:
|
keywords:
|
||||||
- odoo
|
- odoo
|
||||||
|
|||||||
@@ -123,13 +123,25 @@ spec:
|
|||||||
cat > /target/odoosky_hoot_dom_shim/__manifest__.py <<'PYEOF'
|
cat > /target/odoosky_hoot_dom_shim/__manifest__.py <<'PYEOF'
|
||||||
{
|
{
|
||||||
'name': 'OdooSky hoot-dom backend shim',
|
'name': 'OdooSky hoot-dom backend shim',
|
||||||
'version': '18.0.1.0.0',
|
'version': '18.0.1.0.1',
|
||||||
'category': 'Hidden',
|
'category': 'Hidden',
|
||||||
'summary': 'Inject web/static/lib/hoot-dom/**/* into web.assets_backend (workaround for upstream manifest bug)',
|
'summary': 'Inject hoot/hoot-dom + module loader into web.assets_backend (workaround for upstream manifest bug)',
|
||||||
'depends': ['web'],
|
'depends': ['web'],
|
||||||
|
# Mirror the asset list from web.__manifest__.py's
|
||||||
|
# assets_unit_tests_setup bundle. The loader at the
|
||||||
|
# end registers each lib file as an `@odoo/hoot-dom`
|
||||||
|
# module — without it, the bare lib files don't
|
||||||
|
# define themselves as the dependency name production
|
||||||
|
# code references. We exclude the same test artifacts
|
||||||
|
# the upstream bundle excludes (hoot_style.css +
|
||||||
|
# hoot/tests).
|
||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
|
'web/static/lib/hoot/**/*',
|
||||||
'web/static/lib/hoot-dom/**/*',
|
'web/static/lib/hoot-dom/**/*',
|
||||||
|
('remove', 'web/static/lib/hoot/ui/hoot_style.css'),
|
||||||
|
('remove', 'web/static/lib/hoot/tests/**/*'),
|
||||||
|
'web/static/tests/_framework/hoot_module_loader.js',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'installable': True,
|
'installable': True,
|
||||||
@@ -240,21 +252,30 @@ spec:
|
|||||||
# row that adds web/static/lib/hoot-dom/**/* to the
|
# row that adds web/static/lib/hoot-dom/**/* to the
|
||||||
# web.assets_backend bundle on next regeneration. See
|
# web.assets_backend bundle on next regeneration. See
|
||||||
# platform-shim initContainer for the why.
|
# platform-shim initContainer for the why.
|
||||||
SHIM_INSTALLED=""
|
SHIM_INSTALLED_VER=""
|
||||||
IS_INIT_AFTER=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \
|
IS_INIT_AFTER=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \
|
||||||
"SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='ir_module_module'" 2>/dev/null || true)
|
"SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='ir_module_module'" 2>/dev/null || true)
|
||||||
if [ "$IS_INIT_AFTER" = "1" ]; then
|
if [ "$IS_INIT_AFTER" = "1" ]; then
|
||||||
SHIM_INSTALLED=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \
|
SHIM_INSTALLED_VER=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \
|
||||||
"SELECT 1 FROM ir_module_module WHERE name='odoosky_hoot_dom_shim' AND state='installed'" 2>/dev/null || true)
|
"SELECT latest_version FROM ir_module_module WHERE name='odoosky_hoot_dom_shim' AND state='installed'" 2>/dev/null || true)
|
||||||
fi
|
fi
|
||||||
if [ "$SHIM_INSTALLED" = "1" ]; then
|
# Manifest version is the source of truth — on bump, run -u
|
||||||
echo "── odoosky_hoot_dom_shim already installed — skipping ──"
|
# so Odoo re-reads assets and regenerates affected bundles.
|
||||||
else
|
SHIM_MANIFEST_VER=$(awk -F"'" '/version/{print $4; exit}' /mnt/extra-addons/odoosky_hoot_dom_shim/__manifest__.py)
|
||||||
echo "── installing odoosky_hoot_dom_shim (hoot-dom workaround) ──"
|
if [ -z "$SHIM_INSTALLED_VER" ]; then
|
||||||
|
echo "── installing odoosky_hoot_dom_shim ($SHIM_MANIFEST_VER) — hoot-dom workaround ──"
|
||||||
odoo -i odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \
|
odoo -i odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \
|
||||||
--db_host="$HOST" --db_port="$PORT" --db_user="$USER" --db_password="$PASSWORD" \
|
--db_host="$HOST" --db_port="$PORT" --db_user="$USER" --db_password="$PASSWORD" \
|
||||||
--workers=0 \
|
--workers=0 \
|
||||||
--addons-path="/usr/lib/python3/dist-packages/odoo/addons,{{ .Values.addonsMountPath }}"
|
--addons-path="/usr/lib/python3/dist-packages/odoo/addons,{{ .Values.addonsMountPath }}"
|
||||||
|
elif [ "$SHIM_INSTALLED_VER" != "$SHIM_MANIFEST_VER" ]; then
|
||||||
|
echo "── upgrading odoosky_hoot_dom_shim ($SHIM_INSTALLED_VER → $SHIM_MANIFEST_VER) ──"
|
||||||
|
odoo -u odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \
|
||||||
|
--db_host="$HOST" --db_port="$PORT" --db_user="$USER" --db_password="$PASSWORD" \
|
||||||
|
--workers=0 \
|
||||||
|
--addons-path="/usr/lib/python3/dist-packages/odoo/addons,{{ .Values.addonsMountPath }}"
|
||||||
|
else
|
||||||
|
echo "── odoosky_hoot_dom_shim $SHIM_INSTALLED_VER up-to-date — skipping ──"
|
||||||
fi
|
fi
|
||||||
echo "── db-init done ──"
|
echo "── db-init done ──"
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user