2024-12-02 01:16:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# project.sh
|
|
|
|
# Modified: 2024/12/01 15:27:00
|
|
|
|
# Derechos de Autor (C) [2024] [Mauro Rosero P. <mauro@roser.one>]
|
|
|
|
#
|
|
|
|
# Este programa es software libre: usted puede redistribuirlo y/o modificarlo
|
|
|
|
# bajo los términos de la Licencia Pública Affero General de GNU tal como
|
|
|
|
# lo publica la Free Software Foundation, ya sea la versión 3 de la licencia,
|
|
|
|
# o (a su elección) cualquier versión posterior.
|
|
|
|
#
|
|
|
|
# Este programa se distribuye con la esperanza de que sea útil,
|
|
|
|
# pero SIN NINGUNA GARANTÍA; sin siquiera la garantía implícita de
|
|
|
|
# COMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Consulte la
|
|
|
|
# Licencia Pública Affero General de GNU para obtener más detalles.
|
|
|
|
#
|
|
|
|
# Debería haber recibido una copia de la Licencia Pública Affero General
|
|
|
|
# junto con este programa. Si no la recibió, consulte <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
DEVSPATH=developers
|
|
|
|
DEVSTEAM=odoo
|
|
|
|
BIN_HOME=$HOME/$DEVSPATH/$DEVSTEAM
|
|
|
|
BIN_MESG=bin/msg
|
|
|
|
BIN_LIBS=bin/lib
|
2024-12-02 02:42:51 +00:00
|
|
|
VERSION="1.0"
|
2024-12-02 01:16:22 +00:00
|
|
|
|
|
|
|
# CHECK SHELL LANGUAGE
|
|
|
|
BIN_LANG=${LANG:0:2}
|
|
|
|
|
|
|
|
# LOAD BASE BASH LIBRARY
|
|
|
|
source $BIN_HOME/$BIN_LIBS/base.lib
|
|
|
|
#baselib_test
|
|
|
|
|
2024-12-02 02:42:51 +00:00
|
|
|
# LOAD ODOO BASH LIBRARY
|
|
|
|
source $BIN_HOME/$BIN_LIBS/odoo.lib
|
|
|
|
#odoolib_test
|
|
|
|
|
2024-12-02 01:16:22 +00:00
|
|
|
# Load head messages
|
|
|
|
load_messages $BIN_HOME $BIN_MESG $BIN_LANG "head"
|
|
|
|
|
2024-12-02 02:42:51 +00:00
|
|
|
# Load odoo messages
|
|
|
|
load_messages $BIN_HOME $BIN_MESG $BIN_LANG "odoo"
|
|
|
|
|
|
|
|
# Function to display help message
|
|
|
|
function help() {
|
|
|
|
echo "$odmsg_003_1 $0 $odmsg_003_2"
|
|
|
|
echo "$odmsg_004"
|
|
|
|
echo "$odmsg_005"
|
|
|
|
echo "$odmsg_006"
|
|
|
|
echo "$odmsg_007"
|
|
|
|
}
|
|
|
|
|
2024-12-02 01:16:22 +00:00
|
|
|
# Display Headers
|
2024-12-02 02:42:51 +00:00
|
|
|
display_text_header $BIN_HOME "${odmsg_000} ${odmsg_001}"
|
|
|
|
|
|
|
|
# Check for arguments option
|
|
|
|
for arg in "$@"; do
|
|
|
|
case $arg in
|
|
|
|
--help)
|
|
|
|
help
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
--version)
|
|
|
|
echo "$head_version $VERSION"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
# Check if mandatory argument is provided
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
help
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Create odoo project path
|
|
|
|
odoo_structure $BIN_HOME "$1"
|
2024-12-02 01:16:22 +00:00
|
|
|
|
2024-12-02 02:42:51 +00:00
|
|
|
# Copy Dockerfile to build (local)
|
|
|
|
copy_dockerfile $BIN_HOME "$1" "$BIN_HOME/$ODOO_CFG/$DOCKER_LOCAL"
|