dataset/seed/odoo/manual/image/postinstall/odoo.sh

37 lines
2 KiB
Bash
Raw Normal View History

2022-10-01 18:57:37 +02:00
set -e
2022-10-19 15:19:31 +02:00
ODOO_VERSION="16.0"
2022-10-01 18:57:37 +02:00
WKHTML_VERSION="0.12.6.1-2"
#curl http://nightly.odoo.com/${ODOO_VERSION}/nightly/rpm/odoo_${ODOO_VERSION}.latest.rpm -o odoo_${ODOO_VERSION}.latest.rpm
2022-12-25 17:08:52 +01:00
#OPT=$(dnf_opt_base "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP")
2022-10-01 18:57:37 +02:00
#dnf --assumeyes $OPT localinstall odoo_${ODOO_VERSION}.latest.rpm
#rm -f odoo_${ODOO_VERSION}.latest.rpm
2022-12-25 17:08:52 +01:00
mv $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/etc/resolv.conf /tmp
echo "nameserver 9.9.9.9" > $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/etc/resolv.conf
2022-10-01 18:57:37 +02:00
WKHTML_PKG=wkhtmltox_$WKHTML_VERSION.bullseye_amd64.deb
2022-12-25 17:08:52 +01:00
curl https://nightly.odoo.com/odoo.key -o "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/odoo.key"
curl -L "https://github.com/wkhtmltopdf/packaging/releases/download/$WKHTML_VERSION/$WKHTML_PKG" -o "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/$WKHTML_PKG"
2022-10-01 18:57:37 +02:00
echo """#!/bin/bash -xe
cat /odoo.key | apt-key add -
rm /odoo.key
echo "deb http://nightly.odoo.com/$ODOO_VERSION/nightly/deb/ ./" >> /etc/apt/sources.list
apt update
apt install --no-install-recommends -y odoo
dpkg -i /"$WKHTML_PKG" || true
rm -f /"$WKHTML_PKG"
apt -f install -y
2022-12-25 17:08:52 +01:00
""" > $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/install.sh
chmod 755 $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/install.sh
chroot $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP /install.sh
2022-10-01 18:57:37 +02:00
2022-12-25 17:08:52 +01:00
sed -i "s/'postgres'/odoo.tools.config['db_name']/g" $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/lib/python3/dist-packages/odoo/service/server.py
sed -i "s/'postgres'/odoo.tools.config['db_name']/g" $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/lib/python3/dist-packages/odoo/service/db.py
sed -i "s/'postgres'/odoo.tools.config['db_name']/g" $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/lib/python3/dist-packages/odoo/addons/bus/models/bus.py
sed -i "s/'postgres'/odoo.tools.config['db_name']/g" $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_cron.py
sed -i "s@ldap://@ldaps://@g" $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/lib/python3/dist-packages/odoo/addons/auth_ldap/models/res_company_ldap.py
mv -f /tmp/resolv.conf $IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/etc/resolv.conf
2022-10-01 18:57:37 +02:00
set +e