From 30909a3b280b8e14639b50907b8249075e9316b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 2 Feb 2026 17:54:34 +0100 Subject: [PATCH] [IMP] add strict mode (set -euo pipefail) to all scripts Enable bash strict mode in all shell scripts to catch errors early: - set -e: Exit immediately if a command exits with non-zero status - set -u: Treat unset variables as an error - set -o pipefail: Return value of a pipeline is the status of the last command to exit with non-zero status This prevents silent failures and makes debugging easier by failing fast when something goes wrong instead of continuing with potentially corrupted state. --- 13.0/post_upgrade.sh | 1 + 13.0/pre_upgrade.sh | 1 + 13.0/upgrade.sh | 1 + 14.0/post_upgrade.sh | 1 + 14.0/pre_upgrade.sh | 1 + 14.0/upgrade.sh | 1 + 15.0/post_upgrade.sh | 1 + 15.0/pre_upgrade.sh | 1 + 15.0/upgrade.sh | 1 + 16.0/post_upgrade.sh | 1 + 16.0/pre_upgrade.sh | 1 + 16.0/upgrade.sh | 1 + 17.0/post_upgrade.sh | 1 + 17.0/pre_upgrade.sh | 1 + 17.0/upgrade.sh | 1 + 18.0/post_upgrade.sh | 1 + 18.0/pre_upgrade.sh | 1 + 18.0/upgrade.sh | 1 + finalize_db.sh | 1 + prepare_db.sh | 1 + upgrade.sh | 1 + 21 files changed, 21 insertions(+) diff --git a/13.0/post_upgrade.sh b/13.0/post_upgrade.sh index fbc3758..84c6abf 100755 --- a/13.0/post_upgrade.sh +++ b/13.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 13.0..." diff --git a/13.0/pre_upgrade.sh b/13.0/pre_upgrade.sh index 918dd2d..6c5fbb2 100755 --- a/13.0/pre_upgrade.sh +++ b/13.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 13.0..." diff --git a/13.0/upgrade.sh b/13.0/upgrade.sh index ae9b58a..ce600e3 100755 --- a/13.0/upgrade.sh +++ b/13.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8013:8069 ou13 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou13 diff --git a/14.0/post_upgrade.sh b/14.0/post_upgrade.sh index 166206c..53cf99b 100755 --- a/14.0/post_upgrade.sh +++ b/14.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 14.0..." diff --git a/14.0/pre_upgrade.sh b/14.0/pre_upgrade.sh index 81048d5..13b5462 100755 --- a/14.0/pre_upgrade.sh +++ b/14.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 14.0..." diff --git a/14.0/upgrade.sh b/14.0/upgrade.sh index e34695d..f042740 100755 --- a/14.0/upgrade.sh +++ b/14.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8014:8069 ou14 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou14 --load=base,web,openupgrade_framework diff --git a/15.0/post_upgrade.sh b/15.0/post_upgrade.sh index 549c49a..ec3ad04 100755 --- a/15.0/post_upgrade.sh +++ b/15.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 15.0..." diff --git a/15.0/pre_upgrade.sh b/15.0/pre_upgrade.sh index ced1d87..f810210 100755 --- a/15.0/pre_upgrade.sh +++ b/15.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 15.0..." diff --git a/15.0/upgrade.sh b/15.0/upgrade.sh index 31821c6..5f78481 100755 --- a/15.0/upgrade.sh +++ b/15.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8015:8069 ou15 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou15 --load=base,web,openupgrade_framework diff --git a/16.0/post_upgrade.sh b/16.0/post_upgrade.sh index b85f0de..c77da1f 100755 --- a/16.0/post_upgrade.sh +++ b/16.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 16.0..." diff --git a/16.0/pre_upgrade.sh b/16.0/pre_upgrade.sh index 2bc0f8d..12d33bc 100755 --- a/16.0/pre_upgrade.sh +++ b/16.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 16.0..." diff --git a/16.0/upgrade.sh b/16.0/upgrade.sh index 6f5ee09..28087e1 100755 --- a/16.0/upgrade.sh +++ b/16.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8016:8069 ou16 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou16 --load=base,web,openupgrade_framework diff --git a/17.0/post_upgrade.sh b/17.0/post_upgrade.sh index 2caebed..fa2ff53 100755 --- a/17.0/post_upgrade.sh +++ b/17.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 17.0..." diff --git a/17.0/pre_upgrade.sh b/17.0/pre_upgrade.sh index 7b8a5fc..f5c8116 100755 --- a/17.0/pre_upgrade.sh +++ b/17.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 17.0..." diff --git a/17.0/upgrade.sh b/17.0/upgrade.sh index 61877e6..8a73231 100755 --- a/17.0/upgrade.sh +++ b/17.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8017:8069 ou17 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou17 --load=base,web,openupgrade_framework diff --git a/18.0/post_upgrade.sh b/18.0/post_upgrade.sh index ad29951..5fc085c 100755 --- a/18.0/post_upgrade.sh +++ b/18.0/post_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Post migration to 18.0..." diff --git a/18.0/pre_upgrade.sh b/18.0/pre_upgrade.sh index 29953fd..b2c66d2 100755 --- a/18.0/pre_upgrade.sh +++ b/18.0/pre_upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail echo "Prepare migration to 18.0..." diff --git a/18.0/upgrade.sh b/18.0/upgrade.sh index 976d206..53da2ff 100755 --- a/18.0/upgrade.sh +++ b/18.0/upgrade.sh @@ -1,3 +1,4 @@ #!/bin/bash +set -euo pipefail compose -f ../compose.yml run -p 8018:8069 ou18 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou18 --load=base,web,openupgrade_framework diff --git a/finalize_db.sh b/finalize_db.sh index 5a37fed..8047048 100755 --- a/finalize_db.sh +++ b/finalize_db.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail DB_NAME="$1" ODOO_SERVICE="$2" diff --git a/prepare_db.sh b/prepare_db.sh index 0e126a7..a95a7d5 100755 --- a/prepare_db.sh +++ b/prepare_db.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail # Global variables ODOO_SERVICE="$1" diff --git a/upgrade.sh b/upgrade.sh index 4d97e19..7768f2e 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail #################### # GLOBAL VARIABLES #