From ee401b22a7a0ccdc1bb4313207a7d40d778aacf1 Mon Sep 17 00:00:00 2001 From: Alexandre Ferreira Benevides Date: Sat, 25 Feb 2023 23:52:05 -0500 Subject: [PATCH 1/2] [FIX] install OSX: limit hard run.sh and source activate Signed-off-by: Alexandre Ferreira Benevides --- run.sh | 2 +- script/install/install_OSX_dependency.sh | 6 +++--- script/install/install_locally.sh | 5 ++++- script/manifest/update_manifest_local_dev.sh | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/run.sh b/run.sh index 1659f04..f797576 100755 --- a/run.sh +++ b/run.sh @@ -11,7 +11,7 @@ if [ ! -f "${CONFIG_PATH}" ]; then fi fi -python3 ./odoo/odoo-bin -c ${CONFIG_PATH} --limit-time-real 99999 --limit-time-cpu 99999 $@ +python3 ./odoo/odoo-bin -c ${CONFIG_PATH} --limit-time-real 99999 --limit-time-cpu 99999 --limit-memory-hard=0 "$@" retVal=$? if [[ $retVal -ne 0 ]]; then echo "Error run.sh" diff --git a/script/install/install_OSX_dependency.sh b/script/install/install_OSX_dependency.sh index 8319814..f82bed9 100755 --- a/script/install/install_OSX_dependency.sh +++ b/script/install/install_OSX_dependency.sh @@ -13,9 +13,9 @@ EL_USER=${USER} # Install PostgreSQL Server #-------------------------------------------------- echo "\n---- Install PostgreSQL Server ----" -brew install postgresql +brew install postgresql@15 brew install postgis -brew services start postgresql +brew services start postgresql@15 echo "\n---- Creating the ERPLibre PostgreSQL User ----" sudo su - postgres -c "createuser -s ${EL_USER}" 2> /dev/null || true @@ -25,7 +25,7 @@ sudo su - postgres -c "CREATE EXTENSION postgis;\nCREATE EXTENSION postgis_topol # Install Dependencies #-------------------------------------------------- echo "\n--- Installing Python 3 + pip3 --" -brew install git python3 wget +brew install git python@3.7 wget parallel mariadb brew link git brew link wget diff --git a/script/install/install_locally.sh b/script/install/install_locally.sh index ac1c7cb..506a390 100755 --- a/script/install/install_locally.sh +++ b/script/install/install_locally.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate EL_USER=${USER} EL_HOME=$PWD EL_HOME_ODOO="${EL_HOME}/odoo" @@ -94,6 +94,9 @@ if [[ ! -f ${VENV_REPO_PATH} ]]; then sed -i "1 i ${PYTHON_HASHBANG}" ${VENV_REPO_PATH} fi +# Make .venv active +source .venv/bin/activate + # Install Multilingual Markdown Generator if missing if [[ ! -f ${VENV_MULTILINGUAL_MARKDOWN_PATH} ]]; then echo "\n---- Install Multilingual Markdown Generator ----" diff --git a/script/manifest/update_manifest_local_dev.sh b/script/manifest/update_manifest_local_dev.sh index b9ccb75..58a7d57 100755 --- a/script/manifest/update_manifest_local_dev.sh +++ b/script/manifest/update_manifest_local_dev.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml" From bd117ae75508bacdec980b9c33857e50c568c099 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 12 Apr 2023 15:53:35 -0400 Subject: [PATCH 2/2] [ADD] script: source venv activate --- script/install/install_locally_dev.sh | 2 +- script/install/install_production.sh | 2 +- script/install/install_production_nginx.sh | 2 +- script/manifest/update_manifest_dev.sh | 2 +- script/manifest/update_manifest_local_dev_code_generator.sh | 2 +- script/manifest/update_manifest_local_prod.sh | 2 +- script/manifest/update_manifest_prod.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/script/install/install_locally_dev.sh b/script/install/install_locally_dev.sh index bfe9f12..d7ee21f 100755 --- a/script/install/install_locally_dev.sh +++ b/script/install/install_locally_dev.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate ./script/install/install_locally.sh retVal=$? if [[ $retVal -ne 0 ]]; then diff --git a/script/install/install_production.sh b/script/install/install_production.sh index 5895003..77199f8 100755 --- a/script/install/install_production.sh +++ b/script/install/install_production.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate echo -e "\n---- Create ERPLIBRE system user ----" sudo adduser --system --quiet --shell=/bin/bash --home=/${EL_USER} --gecos 'ERPLIBRE' --group ${EL_USER} #The user should also be added to the sudo'ers group. diff --git a/script/install/install_production_nginx.sh b/script/install/install_production_nginx.sh index f38bcc8..0b5ab5e 100755 --- a/script/install/install_production_nginx.sh +++ b/script/install/install_production_nginx.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate TEMP_FILENAME_NGINX_AVAILABLE="localhost" NEW_EL_WEBSITE_NAME="${EL_WEBSITE_NAME}" if [[ -z "${EL_WEBSITE_NAME}" ]]; then diff --git a/script/manifest/update_manifest_dev.sh b/script/manifest/update_manifest_dev.sh index e1804b6..5fc78da 100755 --- a/script/manifest/update_manifest_dev.sh +++ b/script/manifest/update_manifest_dev.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml" diff --git a/script/manifest/update_manifest_local_dev_code_generator.sh b/script/manifest/update_manifest_local_dev_code_generator.sh index 907d45f..aaf0c74 100755 --- a/script/manifest/update_manifest_local_dev_code_generator.sh +++ b/script/manifest/update_manifest_local_dev_code_generator.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml" diff --git a/script/manifest/update_manifest_local_prod.sh b/script/manifest/update_manifest_local_prod.sh index 501ef68..9bda8cc 100755 --- a/script/manifest/update_manifest_local_prod.sh +++ b/script/manifest/update_manifest_local_prod.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml" diff --git a/script/manifest/update_manifest_prod.sh b/script/manifest/update_manifest_prod.sh index f79b6ec..d2f33c6 100755 --- a/script/manifest/update_manifest_prod.sh +++ b/script/manifest/update_manifest_prod.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash . ./env_var.sh - +source .venv/bin/activate #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml"