These collection of bash scripts allows you to update odoo and all the addons contained in OCA. you can use singly or toghether.
update_all.sh
-> it runs the other scripts in the right order. It Stop the odoo service during the update process and restart after finish
update_oca.sh
-> it download the new modules contained in the OCA repository and update the existing ones skipping those specified in the exclude_folder parameter.
update_addons_path.sh
-> it writes the list of addons in the odoo configuration file
update_odoo.sh
-> it update odoo
update_db.sh
-> it install dependencies and update the database
update_git_folders.sh
-> it update folders that can be update by git
WARNING :
- THE SCRIPT DOESN'T MAKE A BACKUP
- for the OCA update GitHub CLI must be installed https://github.com/cli/cli/blob/trunk/docs/install_linux.md
- ubuntu
- odoo installed from source
- odoo configuration file need to be modified with "# end addons" after addon_path list
$ type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
gh config set -h github.com git_protocol https
gh auth login --with-token < mytoken.txt
$ git clone https://github.com/ser-tec/odoo-autoupdate.git
$ cd odoo-autoupdate
$ sudo chmod u+x *.sh
Define your own parameters in update.conf
$ cp update.example.conf update.conf
$ nano update.conf
- Edit cron:
$ sudo crontab -e
- Add the following entries. Save and exit.
Help for scheduling https://crontab.guru/
00 0 * * * /path-odoo-autoupdate/update_all.sh
$ ./path-odoo-autoupdate/update_all.sh