trytondo-sale_opportunity_m.../.dev/run.sh
Jovany Leandro G.C bit4bit@riseup.net 5700dfa12c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
chore: se adiciona entorno vivo de desarrollo
2023-07-27 13:32:15 -05:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# script para iniciar entorno vivo
SCRIPT_DIR=$(dirname `realpath $0`)
die() {
echo $1
exit 1
}
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
[ -z "$DB_NAME" ] && die "se requiere variable DB_NAME"
set -e
# dependencias minimas
pip3 install psycopg2 proteus inotify honcho
# instalar dependencias de tryton desde paquete
python3 setup.py install
# usamos enlace al paquete
python3 setup.py develop
# instalar modulo
trytond_modules_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond/modules
module_name=`cat "$SRC/setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n'`
[ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
ln -sf "$SRC" "$trytond_modules_path/$module_name"
# inicializar base de datos
# https://docs.tryton.org/projects/server/en/latest/tutorial/module/setup_database.html
yes admin | trytond-admin -d ${DB_NAME} --all
# ejecutar servidor
export SCRIPT_DIR
export MODULE_NAME=$module_name
export DB_NAME
export SRC
honcho -d ${SCRIPT_DIR} start