From b787a366925e90cd8fe08c9d8916af94e5808d8e Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Mon, 29 Apr 2024 09:15:26 +0200 Subject: [PATCH] CLN: update references to modes prod and demo These two modes where deprecated in favor of: prod->full,demo->sample - full: mode that will launch scripts that are dependent to production data (not launcher by ci - sample: these are sample related to the customers project. We dont want to mixup with odoo demo data --- HISTORY.rst | 2 ++ README.rst | 18 +++++++++--------- marabunta/config.py | 2 +- marabunta/parser.py | 12 ++++++------ tests/examples/migration.yml | 8 ++++---- tests/examples/migration_no_backup.yml | 8 ++++---- tests/examples/migration_with_backup.yml | 8 ++++---- 7 files changed, 30 insertions(+), 28 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 99033d1..ee78052 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,8 @@ Unreleased **Features** +* mode: demo has been deprecated in favor of sample + **Bugfixes** **Improvements** diff --git a/README.rst b/README.rst index 7508d11..ca26ffc 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ *Marabunta is a name given to the migration of the legionary ants or to the ants themselves. Restless, they eat and digest everything in their way.* -Marabunta is used to provide an easy way to create Updates for Odoo fast and run easily. It also allows to differentiate between different environment to provide for instance demodata. +Marabunta is used to provide an easy way to create Updates for Odoo fast and run easily. It also allows to differentiate between different environment to provide for instance sample data. Usage @@ -24,7 +24,7 @@ Features * backup: Marabunta allows for a backup command to be executed before the migration. * addon upgrades: Marabunta is able to install or upgrade odoo addons. * operations: Allows to execute commands before or after upgrading modules. -* modes: Modes allow the user to execute commands only on a certain environment. e.g. creation of demodata on a dev system. +* modes: Modes allow the user to execute commands only on a certain environment. e.g. creation of sample data on a dev system. * maintenance page: publish an html page during the migration. Versioning systems @@ -63,7 +63,7 @@ Options +-------------------+----------+---------------------------+-------------------------------------------------------------------+ | --web-custom-html | | MARABUNTA_WEB_CUSTOM_HTML | Path to custom maintenance html page to serve. | +-------------------+----------+---------------------------+-------------------------------------------------------------------+ - + YAML layout & Example ===================== Here is an Example migration file:: @@ -77,7 +77,7 @@ Here is an Example migration file:: backup: # Defines how the backup should be done before the migration. command: echo "backup command on ${DB_NAME}" stop_on_failure: true - ignore_if: test "${RUNNING_ENV}" != "prod" + ignore_if: test "${RUNNING_ENV}" != "full" versions: - version: setup # Setup is always the initia. version< operations: @@ -90,19 +90,19 @@ Here is an Example migration file:: - base - document modes: - prod: + full: operations: pre: - - echo 'pre-operation executed only when the mode is prod' + - echo 'pre-operation executed only when the mode is full' post: - anthem songs::load_production_data - demo: + sample: operations: post: - - anthem songs::load_demo_data + - anthem songs::load_sample_data addons: upgrade: - - demo_addon + - sample_addon - version: 0.0.2 backup: false diff --git a/marabunta/config.py b/marabunta/config.py index 615af1f..26e4f12 100644 --- a/marabunta/config.py +++ b/marabunta/config.py @@ -133,7 +133,7 @@ def get_args_parser(): envvar='MARABUNTA_MODE', required=False, help="Specify the mode in which we run the migration," - "such as 'demo' or 'prod'. Additional operations " + "such as 'sample' or 'full'. Additional operations " "of this mode will be executed after the main " "operations and the addons list of this mode " "will be merged with the main addons list.") diff --git a/marabunta/parser.py b/marabunta/parser.py index f12b2fc..1a9d1d6 100644 --- a/marabunta/parser.py +++ b/marabunta/parser.py @@ -28,7 +28,7 @@ backup: command: echo "backup command on $database $db_user $db_password $db_host $db_port" stop_on_failure: true - ignore_if: test "${RUNNING_ENV}" != "prod" + ignore_if: test "${RUNNING_ENV}" != "full" versions: - version: setup operations: @@ -42,19 +42,19 @@ - document # remove: # uninstalled with a python script modes: - prod: + full: operations: pre: - - echo 'pre-operation executed only when the mode is prod' + - echo 'pre-operation executed only when the mode is full' post: - anthem songs::load_production_data - demo: + sample: operations: post: - - anthem songs::load_demo_data + - anthem songs::load_sample_data addons: upgrade: - - demo_addon + - sample_addon - version: 0.0.2 backup: false diff --git a/tests/examples/migration.yml b/tests/examples/migration.yml index b315367..ae85804 100644 --- a/tests/examples/migration.yml +++ b/tests/examples/migration.yml @@ -11,14 +11,14 @@ migration: post: # executed after 'addons' - echo 'post-operation' modes: - prod: + full: operations: pre: - - echo 'pre-operation executed only when the mode is prod' - demo: + - echo 'pre-operation executed only when the mode is full' + sample: operations: post: - - echo 'post-operation executed only when the mode is demo' + - echo 'post-operation executed only when the mode is sample' - version: 0.0.2 # nothing to do diff --git a/tests/examples/migration_no_backup.yml b/tests/examples/migration_no_backup.yml index b74d90d..615961c 100644 --- a/tests/examples/migration_no_backup.yml +++ b/tests/examples/migration_no_backup.yml @@ -11,14 +11,14 @@ migration: post: # executed after 'addons' - echo 'post-operation' modes: - prod: + full: operations: pre: - - echo 'pre-operation executed only when the mode is prod' - demo: + - echo 'pre-operation executed only when the mode is full' + sample: operations: post: - - echo 'post-operation executed only when the mode is demo' + - echo 'post-operation executed only when the mode is sample' - version: 0.0.2 # nothing to do diff --git a/tests/examples/migration_with_backup.yml b/tests/examples/migration_with_backup.yml index ce59fde..4f16425 100644 --- a/tests/examples/migration_with_backup.yml +++ b/tests/examples/migration_with_backup.yml @@ -15,14 +15,14 @@ migration: post: # executed after 'addons' - echo 'post-operation' modes: - prod: + full: operations: pre: - - echo 'pre-operation executed only when the mode is prod' - demo: + - echo 'pre-operation executed only when the mode is full' + sample: operations: post: - - echo 'post-operation executed only when the mode is demo' + - echo 'post-operation executed only when the mode is sample' - version: 0.0.2 # nothing to do