Commit Graph

13 Commits

Author SHA1 Message Date
Stéphan Sainléger
8061d52d25 [FIX] correct return statement outside function
Replace 'return 1' with 'exit 1' in prepare_db.sh.

The 'return' statement is only valid inside functions. When used at
the script's top level, it behaves unpredictably - in some shells it
exits the script, in others it's an error. Using 'exit 1' explicitly
terminates the script with an error status, which is the intended
behavior when the PostgreSQL container is not running.
2026-02-02 22:04:20 +01:00
Stéphan Sainléger
3fe2e93d3d [IMP] use [[ instead of [ for conditionals
Replace single bracket [ ] with double bracket [[ ]] for all test
conditionals in the main scripts.

Benefits of [[ over [:
- No need to quote variables (though we still do for consistency)
- Supports regex matching with =~
- Supports pattern matching with == and !=
- && and || work inside [[ ]] without escaping
- More predictable behavior with empty strings
- Is a bash keyword, not an external command

Note: posbox scripts are left unchanged as they appear to be
third-party code imported into the repository.
2026-02-02 20:06:27 +01:00
Stéphan Sainléger
30909a3b28 [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.
2026-02-02 20:06:27 +01:00
Stéphan Sainléger
743d1ce831 [IMP] adds check view python scripts at db preparation step 2026-01-13 12:38:47 +01:00
Stéphan Sainléger
7aeeccf88e imp: remove add-ons uninstall process
uninstall of add-ons is way too complicated due to dependencies.
the scripts now just list the add-ons that are installed in the
origin database, but not available in the final Odoo docker image.
2024-12-17 23:26:23 +01:00
Stéphan Sainléger
e19c05c812 imp: remove useless final model db name attribute 2024-12-17 15:57:22 +01:00
Stéphan Sainléger
4afbcbf55b imp: several improvements on add-ons uninstall process
- only try to uninstall already installed add-ons
- display the final list of add-ons to remove (dependencies included)
- ask final confirmation
- remove useless temporary files
- clean code
2024-12-17 15:46:05 +01:00
Stéphan Sainléger
116d00091b imp: factorize query_postgres_container() in upgrade.sh 2024-12-17 15:46:05 +01:00
Stéphan Sainléger
53318a1a51 fix: typo on ir_module.state value 2024-12-17 15:46:05 +01:00
Stéphan Sainléger
5057f2821c imp: correction of add-ons to uninstall manual verification 2024-12-17 15:46:05 +01:00
Stéphan Sainléger
d17282586b imp: improve error managment of query_postgres_container output 2024-12-17 15:46:05 +01:00
Stéphan Sainléger
bb482c5a19 fix: replace lokavaluto_postgres_1 by its variable 2024-11-26 09:23:45 +01:00
Stéphan Sainléger
076a7bb3eb [NEW] add first version of 0k Odoo Upgrade scripts 2024-11-26 09:23:45 +01:00