From 3cf91837d6935cb2de0b9c28a046f4b94f0105fa Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 16 Jul 2021 04:29:23 -0400 Subject: [PATCH] [ADD] makefile create database and backup database erplibre_base - Support erplibre_website - Documentation with how test backup --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ doc/RELEASE.md | 15 +++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/Makefile b/Makefile index 7dbc913..6526f73 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,45 @@ db_restore_erplibre_base_db_code_generator: db_restore_erplibre_base_db_template: ./script/db_restore.py --database template +.PHONY: db_create_db_test +db_create_db_test: db_drop_db_test + ./.venv/bin/python3 ./odoo/odoo-bin db --create --database test + +######################## +# Image installation # +######################## +.PHONY: image_db_create_erplibre_base +image_db_create_erplibre_base: + ./script/make.sh db_create_db_test + ./script/addons/install_addons.sh test erplibre_base + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_base + +.PHONY: image_db_create_erplibre_website +image_db_create_erplibre_website: + ./script/make.sh db_create_db_test + ./script/addons/install_addons.sh test erplibre_base,website,erplibre_website_snippets_basic_html,erplibre_website_snippets_cards,erplibre_website_snippets_structures,erplibre_website_snippets_timelines + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website + ./script/addons/install_addons.sh test crm,website_crm + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website_crm + ./script/addons/install_addons.sh test website_livechat + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website_chat_crm + ./script/addons/install_addons.sh test website_sale,erplibre_base_quebec + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_ecommerce_base + +.PHONY: image_db_create_all +image_db_create_all: + ./script/make.sh db_create_db_test + ./script/addons/install_addons.sh test erplibre_base + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_base + ./script/addons/install_addons.sh test website,erplibre_website_snippets_basic_html,erplibre_website_snippets_cards,erplibre_website_snippets_structures,erplibre_website_snippets_timelines + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website + ./script/addons/install_addons.sh test crm,website_crm + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website_crm + ./script/addons/install_addons.sh test website_livechat + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_website_chat_crm + ./script/addons/install_addons.sh test website_sale,erplibre_base_quebec + ./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test --restore_image erplibre_ecommerce_base + ######################### # Addons installation # ######################### diff --git a/doc/RELEASE.md b/doc/RELEASE.md index e912ce9..352bb8a 100644 --- a/doc/RELEASE.md +++ b/doc/RELEASE.md @@ -73,6 +73,21 @@ git commit -am "Release v#.#.#" Review by your peers, test the docker file and merge to master. +## Generate image db to accelerate db installation + +Generate image db before tag, the image is store in directory ./image_db + +```bash +make image_db_create_all +``` + +To test it, you need to clean caches and install it: + +```bash +./script/db_restore.py --clean_cache +./script/db_restore.py --database test --image erplibre_website +``` + ## Create tag Add a tag on the commit in branch master with your release. When adding tag, be sure to update default.xml