Skip to content

Commit

Permalink
CLN: update references to modes prod and demo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
leemannd committed Apr 29, 2024
1 parent 5c549d0 commit b787a36
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 28 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Unreleased

**Features**

* mode: demo has been deprecated in favor of sample

**Bugfixes**

**Improvements**
Expand Down
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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::
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion marabunta/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
12 changes: 6 additions & 6 deletions marabunta/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/examples/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/examples/migration_no_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/examples/migration_with_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b787a36

Please sign in to comment.