From 2352b60ef95ffa5519a834417f92bcd3e98e8a1d Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Fri, 22 Aug 2025 12:09:56 +0200 Subject: [PATCH] fix(config): update environment variables and install scripts for better compatibility --- .env.template | 3 +-- task | 44 ++++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.env.template b/.env.template index 6721607c..00a2dae3 100644 --- a/.env.template +++ b/.env.template @@ -6,8 +6,7 @@ # CONTAINER_REGISTRY=mintsystem/ ODOO_REVISION=18.0.20250725 # ODOO_REVISION_CONTAINER_PULL=true -# GIT_SSH_PUBLIC_KEY="ssh-ed25519 BBBBC3NzaC1lZDI1NTE5BBBBIDR9Ibi0mATjCyx1EYg594oFkY0rghtgo+pnFHOvAcym" -Mint-System-Project-MCC@github.com +# GIT_SSH_PUBLIC_KEY="ssh-ed25519 BBBBC3NzaC1lZDI1NTE5BBBBIDR9Ibi0mATjCyx1EYg594oFkY0rghtgo+pnFHOvAcym Mint-System-Project-MCC@github.com" # GIT_SSH_PRIVATE_KEY="LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLQpiM0JsYm5OemFDMXJaWGt0ZGpFQUFBQUFCRzV2Ym1VQUFBQUVibTl1WlFBQUFBQUFBQUFCQUFBQU13QUFBQXR6YzJndFpXClF5TlRVeE9RQUFBQ0EwZlNHNHRKZ0U0d3NzZFJHSU9mZUtCWkdOSzRJYllLUHFaeFJ6cndITXBnQUFBS2k1WkJhRnVXUVcKaFFBQUFBdHpjMmd0WldReU5UVXhPUUFBQUNBMGZTRzR0SmdFNHdzc2RSR0lPZmVLQlpTks0SWJZS1BxWnhSenJ3SE1wZwowQkFnTT0KLS0tLS1FTkQgT1BFTlNTSCBQUklWQVRFIEtFWS0tLS0tCg==" # GITHUB_USERNAME=bot-mintsys # GITHUB_PERSONAL_ACCESS_TOKEN= diff --git a/task b/task index 1f0e723d..ae33f3e1 100755 --- a/task +++ b/task @@ -876,21 +876,6 @@ function install() { init-venv activate-venv - if [[ "$OS_RELEASE" =~ ^(Arch Linux|Darwin|Debian|Fedora Linux|Ubuntu|Pop!_OS)$ ]]; then - - # Source: https://gist.github.com/faniska/37f896d5e9de5fee925925d7caf3cb9e - INSTALLED_VERSION=$(wkhtmltopdf --version 2>&1 | grep -Po '^wkhtmltopdf \K[\d.]+') - if [ "$INSTALLED_VERSION" != "0.12.4" ]; then - echo -e "\033[38;5;214mWget\033[0m: Install wkhtmltopdf" - wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz - tar xvf wkhtmltox*.tar.xz - sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin - rm -rf wkhtmltox wkhtmltox-0.12.4_linux-generic-amd64.tar.* - else - echo "wkhtmltopdf version is already 0.12.4" - fi - fi - if [[ "$OS_RELEASE" =~ ^(Debian|Ubuntu|Pop!_OS)$ ]]; then echo -e "\033[38;5;214mApt\033[0m: Update apt repo" @@ -919,12 +904,14 @@ function install() { elif [[ "$OS_RELEASE" =~ ^(Darwin)$ ]]; then echo "Welcome daring Mac user. Let's try our best to get this working." - echo "Install wkhtmltopdf and some dev libraries" - echo "This will give a depreciation warning and you need to enter your sudo password." - brew install gettext wkhtmltopdf libsasl2 openldap openssl libxml2 grep + echo -e "\033[38;5;214mBrew\033[0m: Install brew " + brew install gettext libsasl2 openldap openssl libxml2 grep echo -e "\033[38;5;214mPython\033[0m: Install the binary version of psycopg2" - uv pip install psycopg2-binary --force + uv pip install psycopg2-binary + + echo -e "\033[38;5;214mPython\033[0m: Remove psycopg2 from Odoo requirements" + sed -i '/^psycopg2/d' odoo/requirements.txt echo -e "\033[38;5;214mSystem\033[0m: Add LDFLAGS to .env file" if ! grep -qxF 'LDFLAGS=-L/opt/homebrew/lib/' .env; then @@ -944,6 +931,21 @@ function install() { exit 1 fi + if [[ "$OS_RELEASE" =~ ^(Arch\ Linux|Darwin|Debian|Fedora\ Linux|Ubuntu|Pop!_OS)$ ]]; then + + # Source: https://gist.github.com/faniska/37f896d5e9de5fee925925d7caf3cb9e + INSTALLED_VERSION=$(wkhtmltopdf --version 2>&1 | grep -Po '^wkhtmltopdf \K[\d.]+') + if [ "$INSTALLED_VERSION" != "0.12.4" ]; then + echo -e "\033[38;5;214mCurl\033[0m: Install wkhtmltopdf" + curl -L -O https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz + tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz + sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin/ + rm -rf wkhtmltox wkhtmltox-0.12.4_linux-generic-amd64.tar.xz + else + echo "wkhtmltopdf version is already 0.12.4" + fi + fi + if [ ! -d "$HOME/taskfile.build" ]; then echo -e "\033[38;5;214mGit\033[0m: Clone taskfile repo" git clone https://github.com/janikvonrotz/taskfile.build.git ~/taskfile.build @@ -955,7 +957,9 @@ function install() { echo -e "\033[38;5;214mPython\033[0m: Install Odoo development tools" uv pip install ${PYTHON_NOTIFY} uv pip install -r requirements.txt - git clone https://github.com/odoo/upgrade-util + if [ ! -d "upgrade-util" ]; then + git clone https://github.com/odoo/upgrade-util + fi if [ -f "odoo/requirements.txt" ]; then