odoo-devops-tools 1.25.4__tar.gz → 1.27.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/PKG-INFO +183 -146
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/README.md +180 -145
- odoo_devops_tools-1.27.0/odoo_devops_tools/__init__.py +0 -0
- odoo_devops_tools-1.25.4/odoo_devops_tools/env.py → odoo_devops_tools-1.27.0/odoo_devops_tools/odoo_compose.py +240 -114
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/odoo_devops_tools.egg-info/PKG-INFO +183 -146
- odoo_devops_tools-1.27.0/odoo_devops_tools.egg-info/SOURCES.txt +25 -0
- odoo_devops_tools-1.27.0/odoo_devops_tools.egg-info/entry_points.txt +2 -0
- odoo_devops_tools-1.27.0/odoo_devops_tools.egg-info/requires.txt +3 -0
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/odoo_devops_tools.egg-info/top_level.txt +1 -0
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/pyproject.toml +10 -3
- odoo_devops_tools-1.27.0/tests/__init__.py +0 -0
- odoo_devops_tools-1.27.0/tests/common.py +64 -0
- odoo_devops_tools-1.27.0/tests/conftest.py +73 -0
- odoo_devops_tools-1.27.0/tests/integration_support.py +87 -0
- odoo_devops_tools-1.27.0/tests/test_bundle.py +86 -0
- odoo_devops_tools-1.27.0/tests/test_cli.py +47 -0
- odoo_devops_tools-1.27.0/tests/test_completion.py +80 -0
- odoo_devops_tools-1.27.0/tests/test_docker.py +287 -0
- odoo_devops_tools-1.27.0/tests/test_docker_source.py +54 -0
- odoo_devops_tools-1.27.0/tests/test_git.py +152 -0
- odoo_devops_tools-1.27.0/tests/test_git_progress.py +46 -0
- odoo_devops_tools-1.27.0/tests/test_ini.py +187 -0
- odoo_devops_tools-1.27.0/tests/test_lifecycle.py +87 -0
- odoo_devops_tools-1.27.0/tests/test_venv.py +151 -0
- odoo_devops_tools-1.25.4/odoo_devops_tools/__init__.py +0 -1
- odoo_devops_tools-1.25.4/odoo_devops_tools.egg-info/SOURCES.txt +0 -10
- odoo_devops_tools-1.25.4/odoo_devops_tools.egg-info/entry_points.txt +0 -3
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/LICENSE +0 -0
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/odoo_devops_tools.egg-info/dependency_links.txt +0 -0
- {odoo_devops_tools-1.25.4 → odoo_devops_tools-1.27.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.27.0
|
|
4
4
|
Summary: Build reproducible Odoo workspaces from a single project definition.
|
|
5
5
|
Author: Roman Lacko
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,6 +24,8 @@ Classifier: Topic :: Software Development
|
|
|
24
24
|
Requires-Python: >=3.9
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest<10,>=8; extra == "test"
|
|
27
29
|
Dynamic: license-file
|
|
28
30
|
|
|
29
31
|
# odoo-compose
|
|
@@ -52,13 +54,8 @@ From this configuration, `odoo-compose` can generate a workspace such as:
|
|
|
52
54
|
```text
|
|
53
55
|
ROOT/
|
|
54
56
|
├── docker/ # generated Docker artifacts
|
|
55
|
-
│ ├── local/ # Docker workflow artifacts
|
|
56
|
-
│ │ └── configs/ # generated local Odoo config
|
|
57
|
-
│ └── deploy/ # self-contained deploy build context
|
|
58
57
|
├── odoo/ # Odoo source
|
|
59
58
|
├── odoo-addons/ # addon sources
|
|
60
|
-
│ ├── oca-web/
|
|
61
|
-
│ └── oca-helpdesk/
|
|
62
59
|
├── odoo-configs/ # generated Odoo configuration
|
|
63
60
|
├── odoo-data/ # Odoo data directory
|
|
64
61
|
├── odoo-logs/ # runtime logs
|
|
@@ -76,8 +73,7 @@ ROOT/
|
|
|
76
73
|
* **Portable workflows** — create verified bundles with sources and Python wheels for reproducible or offline use.
|
|
77
74
|
* **Python dependency management** — manage Python versions, virtual environments and requirements.
|
|
78
75
|
* **Composable configuration** — combine INI layers, variables, and CLI overrides.
|
|
79
|
-
|
|
80
|
-
`odoo-compose` focuses on creating and maintaining the Odoo workspace and its derived artifacts. Infrastructure provisioning and deployment orchestration remain outside its scope.
|
|
76
|
+
* **Standalone, dependency-free Python script** — run `odoo_compose.py` with the Python standard library alone, or embed the single file in another project.
|
|
81
77
|
|
|
82
78
|
---
|
|
83
79
|
|
|
@@ -105,7 +101,7 @@ odoo-compose --help
|
|
|
105
101
|
|
|
106
102
|
### Shell autocompletion
|
|
107
103
|
|
|
108
|
-
|
|
104
|
+
`odoo-compose` supports `TAB` completion for Docker and native `venv` subcommands,
|
|
109
105
|
options, and filesystem paths. No additional Python dependencies are required.
|
|
110
106
|
|
|
111
107
|
To enable shell autocompletion, run the commands for your shell:
|
|
@@ -114,14 +110,12 @@ To enable shell autocompletion, run the commands for your shell:
|
|
|
114
110
|
|
|
115
111
|
```bash
|
|
116
112
|
echo 'eval "$(odoo-compose completion bash)"' >> ~/.bashrc
|
|
117
|
-
echo 'eval "$(odoo-compose-venv completion bash)"' >> ~/.bashrc
|
|
118
113
|
```
|
|
119
114
|
|
|
120
115
|
**Zsh**
|
|
121
116
|
|
|
122
117
|
```zsh
|
|
123
118
|
echo 'eval "$(odoo-compose completion zsh)"' >> ~/.zshrc
|
|
124
|
-
echo 'eval "$(odoo-compose-venv completion zsh)"' >> ~/.zshrc
|
|
125
119
|
```
|
|
126
120
|
|
|
127
121
|
Zsh's completion system (`compinit`) must be enabled before these lines run.
|
|
@@ -131,7 +125,6 @@ Zsh's completion system (`compinit`) must be enabled before these lines run.
|
|
|
131
125
|
```fish
|
|
132
126
|
mkdir -p ~/.config/fish/completions
|
|
133
127
|
odoo-compose completion fish > ~/.config/fish/completions/odoo-compose.fish
|
|
134
|
-
odoo-compose-venv completion fish > ~/.config/fish/completions/odoo-compose-venv.fish
|
|
135
128
|
```
|
|
136
129
|
|
|
137
130
|
**PowerShell**
|
|
@@ -141,30 +134,27 @@ if (!(Test-Path -Path $PROFILE)) {
|
|
|
141
134
|
New-Item -ItemType File -Path $PROFILE -Force | Out-Null
|
|
142
135
|
}
|
|
143
136
|
Add-Content -Path $PROFILE -Value 'odoo-compose completion powershell | Out-String | Invoke-Expression'
|
|
144
|
-
Add-Content -Path $PROFILE -Value 'odoo-compose-venv completion powershell | Out-String | Invoke-Expression'
|
|
145
137
|
```
|
|
146
138
|
|
|
147
139
|
Restart your shell or reload its configuration to activate completion. For example,
|
|
148
|
-
`odoo-compose setup --sy<TAB>` suggests matching options such as `--sync`,
|
|
140
|
+
`odoo-compose docker setup --sy<TAB>` suggests matching options such as `--sync`,
|
|
149
141
|
`--sync-odoo`, `--sync-addons`, and `--sync-all`.
|
|
150
142
|
|
|
151
|
-
---
|
|
152
|
-
|
|
153
143
|
## Usage
|
|
154
144
|
|
|
155
|
-
`odoo-devops-tools` supports two development workflows
|
|
145
|
+
`odoo-devops-tools` supports two development workflows:
|
|
156
146
|
|
|
157
|
-
- **Docker workflow (`odoo-compose`)** — run Odoo and PostgreSQL with the generated Docker Compose environment.
|
|
158
|
-
- **Native development with venv (`odoo-compose
|
|
147
|
+
- **Docker workflow (`odoo-compose docker`)** — run Odoo and PostgreSQL with the generated Docker Compose environment.
|
|
148
|
+
- **Native development with venv (`odoo-compose venv`)** — run Odoo directly on the host using a generated Python virtual environment.
|
|
159
149
|
|
|
160
|
-
|
|
150
|
+
Every workspace command must specify its workflow explicitly (`docker` or `venv`); no implicit default is used. Both share the same `odoo-project.ini` project definition. `odoo-compose --help`, `odoo-compose --version` and `odoo-compose completion SHELL` remain global.
|
|
161
151
|
|
|
162
152
|
## 1. Docker workflow
|
|
163
153
|
|
|
164
154
|
Create a new workspace:
|
|
165
155
|
|
|
166
156
|
```bash
|
|
167
|
-
odoo-compose setup ./odoo19
|
|
157
|
+
odoo-compose docker setup ./odoo19
|
|
168
158
|
```
|
|
169
159
|
|
|
170
160
|
This creates `./odoo19/odoo-project.ini` with this initial content:
|
|
@@ -178,13 +168,13 @@ Then prepare and start the Docker Compose environment:
|
|
|
178
168
|
|
|
179
169
|
```bash
|
|
180
170
|
cd ./odoo19
|
|
181
|
-
odoo-compose up --build
|
|
171
|
+
odoo-compose docker up --build
|
|
182
172
|
```
|
|
183
173
|
|
|
184
174
|
Optionally initialize the Odoo database from the command line instead of through the web interface:
|
|
185
175
|
|
|
186
176
|
```bash
|
|
187
|
-
odoo-compose run -i base --without-demo=all --stop-after-init
|
|
177
|
+
odoo-compose docker run -i base --without-demo=all --stop-after-init
|
|
188
178
|
```
|
|
189
179
|
|
|
190
180
|
Docker Compose runs both Odoo and PostgreSQL. Odoo is available at http://localhost:8069.
|
|
@@ -193,8 +183,8 @@ Docker Compose runs both Odoo and PostgreSQL. Odoo is available at http://localh
|
|
|
193
183
|
> By default, generated Compose services use `restart: unless-stopped`; to prevent a development stack from automatically starting after a host or Docker restart, run:
|
|
194
184
|
>
|
|
195
185
|
> ```bash
|
|
196
|
-
> odoo-compose setup --set docker:restart=no
|
|
197
|
-
> odoo-compose up --build
|
|
186
|
+
> odoo-compose docker setup --set docker:restart=no
|
|
187
|
+
> odoo-compose docker up --build
|
|
198
188
|
> ```
|
|
199
189
|
|
|
200
190
|
### 1.1. Adding extra addons
|
|
@@ -216,8 +206,8 @@ branch = ${odoo:version}
|
|
|
216
206
|
Sync the addon repositories and regenerate the Docker environment:
|
|
217
207
|
|
|
218
208
|
```bash
|
|
219
|
-
odoo-compose setup --sync
|
|
220
|
-
odoo-compose up --build
|
|
209
|
+
odoo-compose docker setup --sync
|
|
210
|
+
odoo-compose docker up --build
|
|
221
211
|
```
|
|
222
212
|
|
|
223
213
|
The repositories are cloned into `ROOT/odoo-addons/` and bind-mounted into the Odoo container. Python dependencies from their `requirements.txt` files are included when rebuilding the Docker image.
|
|
@@ -225,13 +215,13 @@ The repositories are cloned into `ROOT/odoo-addons/` and bind-mounted into the O
|
|
|
225
215
|
Install the new modules:
|
|
226
216
|
|
|
227
217
|
```bash
|
|
228
|
-
odoo-compose run -i web_notify,helpdesk_mgmt --without-demo=all --stop-after-init
|
|
218
|
+
odoo-compose docker run -i web_notify,helpdesk_mgmt --without-demo=all --stop-after-init
|
|
229
219
|
```
|
|
230
220
|
|
|
231
221
|
For subsequent addon updates, use:
|
|
232
222
|
|
|
233
223
|
```bash
|
|
234
|
-
odoo-compose update
|
|
224
|
+
odoo-compose docker update
|
|
235
225
|
```
|
|
236
226
|
|
|
237
227
|
### 1.2. Running Odoo from workspace source
|
|
@@ -255,8 +245,8 @@ odoo_source = workspace
|
|
|
255
245
|
Sync the Odoo source and generate the Docker artifacts:
|
|
256
246
|
|
|
257
247
|
```bash
|
|
258
|
-
odoo-compose setup --sync
|
|
259
|
-
odoo-compose up --build
|
|
248
|
+
odoo-compose docker setup --sync
|
|
249
|
+
odoo-compose docker up --build
|
|
260
250
|
```
|
|
261
251
|
|
|
262
252
|
The resolved Odoo source is bind-mounted read-only at `/opt/odoo`. The Odoo Python source from the base image is removed while its installed dependencies remain available.
|
|
@@ -266,15 +256,15 @@ The resolved Odoo source is bind-mounted read-only at `/opt/odoo`. The Odoo Pyth
|
|
|
266
256
|
Enable Mailpit in the local Docker workflow when you need to inspect or test email without sending it to a real SMTP server:
|
|
267
257
|
|
|
268
258
|
```bash
|
|
269
|
-
odoo-compose setup --set docker:mailpit_enabled=true
|
|
270
|
-
odoo-compose up
|
|
259
|
+
odoo-compose docker setup --set docker:mailpit_enabled=true
|
|
260
|
+
odoo-compose docker up
|
|
271
261
|
```
|
|
272
262
|
|
|
273
263
|
Mailpit is available at http://localhost:8025 by default. When running multiple workspaces, override the host web UI port, for example:
|
|
274
264
|
|
|
275
265
|
```bash
|
|
276
|
-
odoo-compose setup --set docker:mailpit_enabled=true --set docker:mailpit_webui_port=8026
|
|
277
|
-
odoo-compose up
|
|
266
|
+
odoo-compose docker setup --set docker:mailpit_enabled=true --set docker:mailpit_webui_port=8026
|
|
267
|
+
odoo-compose docker up
|
|
278
268
|
```
|
|
279
269
|
|
|
280
270
|
The generated local Odoo configuration sends outgoing email to `mailpit:1025`. When Mailpit is enabled, local Docker SMTP connection settings (`smtp_server`, `smtp_port`, `smtp_ssl`, `smtp_user`, and `smtp_password`) are intentionally overridden; the deploy configuration keeps the values from `[config]` unchanged.
|
|
@@ -319,7 +309,7 @@ Each option is independent and optional. If an option is missing or empty, `odoo
|
|
|
319
309
|
Apply the updated resource limits and start the services. `up` regenerates the Compose configuration automatically, so no separate `setup` or image rebuild is necessary:
|
|
320
310
|
|
|
321
311
|
```bash
|
|
322
|
-
odoo-compose up
|
|
312
|
+
odoo-compose docker up
|
|
323
313
|
```
|
|
324
314
|
|
|
325
315
|
### 1.6. Creating a Docker deploy build context
|
|
@@ -329,13 +319,13 @@ Use `--create-docker-deploy` to generate a self-contained Docker build context f
|
|
|
329
319
|
Addon modules are staged into the build context so the resulting image does not depend on bind-mounted workspace sources:
|
|
330
320
|
|
|
331
321
|
```bash
|
|
332
|
-
odoo-compose setup --sync --create-docker-deploy
|
|
322
|
+
odoo-compose docker setup --sync --create-docker-deploy
|
|
333
323
|
```
|
|
334
324
|
|
|
335
325
|
When `[docker].odoo_source = workspace`, sync the Odoo source as well:
|
|
336
326
|
|
|
337
327
|
```bash
|
|
338
|
-
odoo-compose setup --sync --create-docker-deploy
|
|
328
|
+
odoo-compose docker setup --sync --create-docker-deploy
|
|
339
329
|
```
|
|
340
330
|
|
|
341
331
|
This additionally creates:
|
|
@@ -364,7 +354,7 @@ In this workflow, Odoo runs directly on the host using a generated Python virtua
|
|
|
364
354
|
Create the workspace with the Odoo source and virtual environment:
|
|
365
355
|
|
|
366
356
|
```bash
|
|
367
|
-
odoo-compose
|
|
357
|
+
odoo-compose venv setup ./odoo19 --sync --create-venv \
|
|
368
358
|
--set config:db_host=127.0.0.1 \
|
|
369
359
|
--set config:db_name=odoo \
|
|
370
360
|
--set config:db_user=odoo \
|
|
@@ -391,17 +381,17 @@ Then start Odoo in the background:
|
|
|
391
381
|
|
|
392
382
|
```bash
|
|
393
383
|
cd ./odoo19
|
|
394
|
-
odoo-compose
|
|
395
|
-
odoo-compose
|
|
384
|
+
odoo-compose venv up
|
|
385
|
+
odoo-compose venv status
|
|
396
386
|
```
|
|
397
387
|
|
|
398
388
|
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
399
389
|
|
|
400
|
-
Use `odoo-compose
|
|
390
|
+
Use `odoo-compose venv run` instead to run in the foreground:
|
|
401
391
|
|
|
402
392
|
```bash
|
|
403
393
|
cd ./odoo19
|
|
404
|
-
odoo-compose
|
|
394
|
+
odoo-compose venv run
|
|
405
395
|
```
|
|
406
396
|
|
|
407
397
|
### 2.1. Adding extra addons
|
|
@@ -423,7 +413,7 @@ branch = ${odoo:version}
|
|
|
423
413
|
Sync the addon repositories and recreate the Python environment to include their dependencies:
|
|
424
414
|
|
|
425
415
|
```bash
|
|
426
|
-
odoo-compose
|
|
416
|
+
odoo-compose venv setup --sync --create-venv
|
|
427
417
|
```
|
|
428
418
|
|
|
429
419
|
The repositories are cloned into `ROOT/odoo-addons/` and automatically added to the generated `addons_path`. Python dependencies from their `requirements.txt` files are included in the virtual environment.
|
|
@@ -431,13 +421,13 @@ The repositories are cloned into `ROOT/odoo-addons/` and automatically added to
|
|
|
431
421
|
Install the new modules:
|
|
432
422
|
|
|
433
423
|
```bash
|
|
434
|
-
odoo-compose
|
|
424
|
+
odoo-compose venv run -i web_notify,helpdesk_mgmt
|
|
435
425
|
```
|
|
436
426
|
|
|
437
427
|
For subsequent addon updates, use:
|
|
438
428
|
|
|
439
429
|
```bash
|
|
440
|
-
odoo-compose
|
|
430
|
+
odoo-compose venv update
|
|
441
431
|
```
|
|
442
432
|
|
|
443
433
|
The `update` command uses `click-odoo-update` with the workspace Odoo configuration.
|
|
@@ -467,7 +457,7 @@ python_version = 3.11
|
|
|
467
457
|
After changing the project file, run `odoo-compose` again from the workspace root:
|
|
468
458
|
|
|
469
459
|
```bash
|
|
470
|
-
odoo-compose
|
|
460
|
+
odoo-compose venv setup --sync --create-venv
|
|
471
461
|
```
|
|
472
462
|
|
|
473
463
|
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
@@ -557,19 +547,19 @@ Those machine-specific outputs are recreated on the target machine.
|
|
|
557
547
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
558
548
|
|
|
559
549
|
```bash
|
|
560
|
-
odoo-compose
|
|
550
|
+
odoo-compose venv setup --sync --create-venv --create-bundle
|
|
561
551
|
```
|
|
562
552
|
|
|
563
553
|
When no output path is supplied, the bundle is written to:
|
|
564
554
|
|
|
565
555
|
```text
|
|
566
|
-
ROOT/
|
|
556
|
+
ROOT/bundles/ROOT-NAME-bundle.zip
|
|
567
557
|
```
|
|
568
558
|
|
|
569
559
|
You can also select an explicit output file:
|
|
570
560
|
|
|
571
561
|
```bash
|
|
572
|
-
odoo-compose
|
|
562
|
+
odoo-compose venv setup --sync --create-venv --create-bundle ./artifacts/odoo18-production-bundle.zip
|
|
573
563
|
```
|
|
574
564
|
|
|
575
565
|
#### 4.1.1. Including uncommitted changes
|
|
@@ -579,7 +569,7 @@ By default, bundle creation stops when a bundled Git repository has uncommitted
|
|
|
579
569
|
To intentionally include those changes in the bundle, use:
|
|
580
570
|
|
|
581
571
|
```bash
|
|
582
|
-
odoo-compose
|
|
572
|
+
odoo-compose venv setup --sync --create-venv --create-bundle --allow-dirty-bundle
|
|
583
573
|
```
|
|
584
574
|
|
|
585
575
|
### 4.2. Create the workspace on the target machine
|
|
@@ -587,7 +577,7 @@ odoo-compose-venv setup --sync --create-venv --create-bundle --allow-dirty-bundl
|
|
|
587
577
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
588
578
|
|
|
589
579
|
```bash
|
|
590
|
-
odoo-compose
|
|
580
|
+
odoo-compose venv setup --create-from-bundle ./odoo18-production-bundle.zip \
|
|
591
581
|
--root ./odoo18-prod \
|
|
592
582
|
--set config:db_host=127.0.0.1 \
|
|
593
583
|
--set config:db_name=odoo \
|
|
@@ -614,32 +604,60 @@ The import operation:
|
|
|
614
604
|
The existing manual workflow remains available. After preparing a complete workspace on the build machine, copy the whole workspace and run this command from the copied root:
|
|
615
605
|
|
|
616
606
|
```bash
|
|
617
|
-
odoo-compose
|
|
607
|
+
odoo-compose venv setup --create-venv-from-wheelhouse
|
|
618
608
|
```
|
|
619
609
|
|
|
620
610
|
This recreates `ROOT/venv`, skips dependency compilation and wheelhouse building, and installs strictly from the existing `ROOT/wheelhouse/` and `all-requirements.lock.txt`.
|
|
621
611
|
|
|
622
612
|
---
|
|
623
613
|
|
|
614
|
+
## Standalone and embedded usage
|
|
615
|
+
|
|
616
|
+
The core CLI is intentionally implemented in a **single Python file**, `odoo_devops_tools/odoo_compose.py`, using **only the Python standard library**. You can copy that file into another project and run it directly, without installing the `odoo-devops-tools` Python package or any third-party Python libraries.
|
|
617
|
+
|
|
618
|
+
For example, copy `odoo_compose.py` into your project alongside `odoo-project.ini`:
|
|
619
|
+
|
|
620
|
+
```text
|
|
621
|
+
my-project/
|
|
622
|
+
├── odoo_compose.py
|
|
623
|
+
└── odoo-project.ini
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
Then run the Docker workflow from the project directory:
|
|
627
|
+
|
|
628
|
+
```bash
|
|
629
|
+
python odoo_compose.py docker setup --sync
|
|
630
|
+
python odoo_compose.py docker up --build
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
For the native venv workflow, choose the `venv` prefix:
|
|
634
|
+
|
|
635
|
+
```bash
|
|
636
|
+
python odoo_compose.py venv setup --sync --create-venv
|
|
637
|
+
python odoo_compose.py venv run
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
624
642
|
## Runtime lifecycle
|
|
625
643
|
|
|
626
|
-
Use the same lifecycle commands with either
|
|
644
|
+
Use the same lifecycle commands with either workflow after provisioning the workspace with `setup`:
|
|
627
645
|
|
|
628
646
|
```bash
|
|
629
647
|
# Docker: generate Docker config and start the Compose stack
|
|
630
|
-
odoo-compose up --build
|
|
631
|
-
odoo-compose status
|
|
632
|
-
odoo-compose down
|
|
648
|
+
odoo-compose docker up --build
|
|
649
|
+
odoo-compose docker status
|
|
650
|
+
odoo-compose docker down
|
|
633
651
|
|
|
634
652
|
# Native: generate config and start Odoo in the background
|
|
635
|
-
odoo-compose
|
|
636
|
-
odoo-compose
|
|
637
|
-
odoo-compose
|
|
653
|
+
odoo-compose venv up
|
|
654
|
+
odoo-compose venv status
|
|
655
|
+
odoo-compose venv down
|
|
638
656
|
```
|
|
639
657
|
|
|
640
|
-
`odoo-compose up` regenerates local workspace artifacts and then runs the equivalent of `docker compose up -d --wait`.
|
|
658
|
+
`odoo-compose docker up` regenerates local workspace artifacts and then runs the equivalent of `docker compose up -d --wait`.
|
|
641
659
|
|
|
642
|
-
`odoo-compose up --build` additionally builds the images (`docker compose up -d --build --wait`).
|
|
660
|
+
`odoo-compose docker up --build` additionally builds the images (`docker compose up -d --build --wait`).
|
|
643
661
|
|
|
644
662
|
Container orchestration remains with Docker Compose, and its CLI can still be used directly for advanced or service-specific operations.
|
|
645
663
|
|
|
@@ -649,9 +667,9 @@ Container orchestration remains with Docker Compose, and its CLI can still be us
|
|
|
649
667
|
|
|
650
668
|
## Commands
|
|
651
669
|
|
|
652
|
-
`odoo-compose` operates on Docker workspaces; `odoo-compose
|
|
670
|
+
`odoo-compose docker` operates on Docker workspaces; `odoo-compose venv` operates on native Python virtualenv workspaces. Both use `ROOT/odoo-project.ini`, but generate their own workflow artifacts. Commands operate directly through the installed CLI; generated wrapper scripts are not required.
|
|
653
671
|
|
|
654
|
-
Running
|
|
672
|
+
Running `odoo-compose` without arguments displays help. Workspace commands require an explicit `docker` or `venv` prefix; bare commands such as `odoo-compose setup` are no longer accepted. Use `odoo-compose docker <command> --help` or `odoo-compose venv <command> --help` for command-specific help. The global `--version` option shows the installed CLI version. Use `--root ROOT` to select a workspace outside the current directory where supported.
|
|
655
673
|
|
|
656
674
|
### Overview
|
|
657
675
|
|
|
@@ -715,7 +733,7 @@ Create or update an Odoo workspace. When no project file exists, `setup` creates
|
|
|
715
733
|
**Usage**
|
|
716
734
|
|
|
717
735
|
```text
|
|
718
|
-
{odoo-compose|odoo-compose
|
|
736
|
+
{odoo-compose|odoo-compose venv} setup [ROOT|INI] [OPTIONS]
|
|
719
737
|
```
|
|
720
738
|
|
|
721
739
|
**Arguments**
|
|
@@ -730,14 +748,14 @@ Alternatively, load the workspace definition from a local INI file, Git reposito
|
|
|
730
748
|
|
|
731
749
|
```bash
|
|
732
750
|
# Docker workflow:
|
|
733
|
-
odoo-compose setup /path/to/odoo-project.ini
|
|
734
|
-
odoo-compose setup 'git+git@github.com:company/repo.git//examples/odoo-project.ini?ref=main'
|
|
735
|
-
odoo-compose setup 'https://github.com/lck/odoo-devops-tools/blob/main/examples/odoo-project.ini'
|
|
751
|
+
odoo-compose docker setup /path/to/odoo-project.ini
|
|
752
|
+
odoo-compose docker setup 'git+git@github.com:company/repo.git//examples/odoo-project.ini?ref=main'
|
|
753
|
+
odoo-compose docker setup 'https://github.com/lck/odoo-devops-tools/blob/main/examples/odoo-project.ini'
|
|
736
754
|
|
|
737
755
|
# Native workflow:
|
|
738
|
-
odoo-compose
|
|
739
|
-
odoo-compose
|
|
740
|
-
odoo-compose
|
|
756
|
+
odoo-compose venv setup /path/to/odoo-project.ini
|
|
757
|
+
odoo-compose venv setup 'git+git@github.com:company/repo.git//examples/odoo-project.ini?ref=main'
|
|
758
|
+
odoo-compose venv setup 'https://github.com/lck/odoo-devops-tools/blob/main/examples/odoo-project.ini'
|
|
741
759
|
```
|
|
742
760
|
|
|
743
761
|
Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
|
|
@@ -793,7 +811,7 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
|
|
|
793
811
|
|
|
794
812
|
</dl>
|
|
795
813
|
|
|
796
|
-
**Virtualenv and bundles** (`odoo-compose
|
|
814
|
+
**Virtualenv and bundles** (`odoo-compose venv` only where indicated)
|
|
797
815
|
|
|
798
816
|
<dl class="cli-reference">
|
|
799
817
|
<dt><code>--create-venv</code></dt>
|
|
@@ -806,7 +824,7 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
|
|
|
806
824
|
<dd><p>Remove all items from pip's wheel cache.</p></dd>
|
|
807
825
|
|
|
808
826
|
<dt><code>--create-bundle</code> <i>[BUNDLE]</i></dt>
|
|
809
|
-
<dd><p>Create a verified portable ZIP containing sources, a sanitized project INI and the wheelhouse (Venv only). Default output: <code>ROOT/
|
|
827
|
+
<dd><p>Create a verified portable ZIP containing sources, a sanitized project INI and the wheelhouse (Venv only). Default output: <code>ROOT/bundles/ROOT-NAME-bundle.zip</code>. Explicit relative paths are resolved from the current directory.</p></dd>
|
|
810
828
|
|
|
811
829
|
<dt><code>--allow-dirty-bundle</code></dt>
|
|
812
830
|
<dd><p>Allow bundle creation from repositories with uncommitted changes; otherwise dirty repositories abort the operation.</p></dd>
|
|
@@ -828,12 +846,12 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
|
|
|
828
846
|
|
|
829
847
|
```bash
|
|
830
848
|
# Docker workflow:
|
|
831
|
-
odoo-compose setup ./odoo19
|
|
832
|
-
odoo-compose setup ./odoo18 --set odoo:version=18.0
|
|
849
|
+
odoo-compose docker setup ./odoo19
|
|
850
|
+
odoo-compose docker setup ./odoo18 --set odoo:version=18.0
|
|
833
851
|
|
|
834
852
|
# Native workflow:
|
|
835
|
-
odoo-compose
|
|
836
|
-
odoo-compose
|
|
853
|
+
odoo-compose venv setup ./odoo19 --sync --create-venv
|
|
854
|
+
odoo-compose venv setup ./odoo18 --set odoo:version=18.0 --sync-all --create-venv
|
|
837
855
|
```
|
|
838
856
|
|
|
839
857
|
### `up`
|
|
@@ -843,8 +861,8 @@ Prepare and start the selected workspace. Requires an existing `odoo-project.ini
|
|
|
843
861
|
**Usage**
|
|
844
862
|
|
|
845
863
|
```text
|
|
846
|
-
{odoo-compose|odoo-compose
|
|
847
|
-
odoo-compose up [--root ROOT] [--build] [--recreate]
|
|
864
|
+
{odoo-compose|odoo-compose venv} up [--root ROOT]
|
|
865
|
+
odoo-compose docker up [--root ROOT] [--build] [--recreate]
|
|
848
866
|
```
|
|
849
867
|
|
|
850
868
|
**Options**
|
|
@@ -868,12 +886,12 @@ Native `up` uses `ROOT/.odt-env/odoo-process.json` for process identity and writ
|
|
|
868
886
|
|
|
869
887
|
### `down`
|
|
870
888
|
|
|
871
|
-
Stop the selected workspace, preserving data. Docker delegates to `docker compose down` **without** `--volumes`; native gracefully stops only the verified Odoo process created by `odoo-compose
|
|
889
|
+
Stop the selected workspace, preserving data. Docker delegates to `docker compose down` **without** `--volumes`; native gracefully stops only the verified Odoo process created by `odoo-compose venv up`.
|
|
872
890
|
|
|
873
891
|
**Usage**
|
|
874
892
|
|
|
875
893
|
```text
|
|
876
|
-
{odoo-compose|odoo-compose
|
|
894
|
+
{odoo-compose|odoo-compose venv} down [--root ROOT]
|
|
877
895
|
```
|
|
878
896
|
|
|
879
897
|
**Options**
|
|
@@ -894,7 +912,7 @@ Show runtime status without provisioning or changing the workspace. Docker displ
|
|
|
894
912
|
**Usage**
|
|
895
913
|
|
|
896
914
|
```text
|
|
897
|
-
{odoo-compose|odoo-compose
|
|
915
|
+
{odoo-compose|odoo-compose venv} status [--root ROOT]
|
|
898
916
|
```
|
|
899
917
|
|
|
900
918
|
**Options**
|
|
@@ -915,7 +933,7 @@ Run Odoo directly from the selected workspace. Docker uses a one-off container;
|
|
|
915
933
|
**Usage**
|
|
916
934
|
|
|
917
935
|
```text
|
|
918
|
-
{odoo-compose|odoo-compose
|
|
936
|
+
{odoo-compose|odoo-compose venv} run [--root ROOT] [ODOO_ARGS...]
|
|
919
937
|
```
|
|
920
938
|
|
|
921
939
|
**Arguments**
|
|
@@ -938,10 +956,10 @@ Run Odoo directly from the selected workspace. Docker uses a one-off container;
|
|
|
938
956
|
|
|
939
957
|
```bash
|
|
940
958
|
# Docker workflow:
|
|
941
|
-
odoo-compose run -i base --stop-after-init
|
|
959
|
+
odoo-compose docker run -i base --stop-after-init
|
|
942
960
|
|
|
943
961
|
# Native workflow:
|
|
944
|
-
odoo-compose
|
|
962
|
+
odoo-compose venv run -i base --stop-after-init
|
|
945
963
|
```
|
|
946
964
|
|
|
947
965
|
### `shell`
|
|
@@ -951,7 +969,7 @@ Open an interactive Odoo shell. Like `run`, this uses a one-off container for Do
|
|
|
951
969
|
**Usage**
|
|
952
970
|
|
|
953
971
|
```text
|
|
954
|
-
{odoo-compose|odoo-compose
|
|
972
|
+
{odoo-compose|odoo-compose venv} shell [--root ROOT] [ODOO_ARGS...]
|
|
955
973
|
```
|
|
956
974
|
|
|
957
975
|
**Arguments**
|
|
@@ -974,10 +992,10 @@ Open an interactive Odoo shell. Like `run`, this uses a one-off container for Do
|
|
|
974
992
|
|
|
975
993
|
```bash
|
|
976
994
|
# Docker workflow:
|
|
977
|
-
odoo-compose shell
|
|
995
|
+
odoo-compose docker shell
|
|
978
996
|
|
|
979
997
|
# Native workflow:
|
|
980
|
-
odoo-compose
|
|
998
|
+
odoo-compose venv shell
|
|
981
999
|
```
|
|
982
1000
|
|
|
983
1001
|
### `update`
|
|
@@ -987,7 +1005,7 @@ Update installed Odoo addons through `click-odoo-update`.
|
|
|
987
1005
|
**Usage**
|
|
988
1006
|
|
|
989
1007
|
```text
|
|
990
|
-
{odoo-compose|odoo-compose
|
|
1008
|
+
{odoo-compose|odoo-compose venv} update [--root ROOT] [--all] [ODOO_ARGS...]
|
|
991
1009
|
```
|
|
992
1010
|
|
|
993
1011
|
**Arguments**
|
|
@@ -1013,10 +1031,10 @@ Update installed Odoo addons through `click-odoo-update`.
|
|
|
1013
1031
|
|
|
1014
1032
|
```bash
|
|
1015
1033
|
# Docker workflow:
|
|
1016
|
-
odoo-compose update --all
|
|
1034
|
+
odoo-compose docker update --all
|
|
1017
1035
|
|
|
1018
1036
|
# Native workflow:
|
|
1019
|
-
odoo-compose
|
|
1037
|
+
odoo-compose venv update --all
|
|
1020
1038
|
```
|
|
1021
1039
|
|
|
1022
1040
|
### `test`
|
|
@@ -1026,7 +1044,7 @@ Run Odoo with `--test-enable --stop-after-init` in either workflow.
|
|
|
1026
1044
|
**Usage**
|
|
1027
1045
|
|
|
1028
1046
|
```text
|
|
1029
|
-
{odoo-compose|odoo-compose
|
|
1047
|
+
{odoo-compose|odoo-compose venv} test [--root ROOT] [ODOO_ARGS...]
|
|
1030
1048
|
```
|
|
1031
1049
|
|
|
1032
1050
|
**Arguments**
|
|
@@ -1049,10 +1067,10 @@ Run Odoo with `--test-enable --stop-after-init` in either workflow.
|
|
|
1049
1067
|
|
|
1050
1068
|
```bash
|
|
1051
1069
|
# Docker workflow:
|
|
1052
|
-
odoo-compose test -i sale --test-tags /sale
|
|
1070
|
+
odoo-compose docker test -i sale --test-tags /sale
|
|
1053
1071
|
|
|
1054
1072
|
# Native workflow:
|
|
1055
|
-
odoo-compose
|
|
1073
|
+
odoo-compose venv test -i sale --test-tags /sale
|
|
1056
1074
|
```
|
|
1057
1075
|
|
|
1058
1076
|
> **Docker note:** Docker commands use one-off containers. Set `ODOO_DOCKER_SUDO=1` on Linux if Docker requires `sudo`.
|
|
@@ -1064,7 +1082,7 @@ Create a PostgreSQL custom-format database dump.
|
|
|
1064
1082
|
**Usage**
|
|
1065
1083
|
|
|
1066
1084
|
```text
|
|
1067
|
-
{odoo-compose|odoo-compose
|
|
1085
|
+
{odoo-compose|odoo-compose venv} backup-db [--root ROOT] [OUTPUT]
|
|
1068
1086
|
```
|
|
1069
1087
|
|
|
1070
1088
|
**Arguments**
|
|
@@ -1087,15 +1105,15 @@ Create a PostgreSQL custom-format database dump.
|
|
|
1087
1105
|
|
|
1088
1106
|
```bash
|
|
1089
1107
|
# Docker workflow:
|
|
1090
|
-
odoo-compose backup-db
|
|
1108
|
+
odoo-compose docker backup-db
|
|
1091
1109
|
|
|
1092
1110
|
# Native only: select a specific version of the PostgreSQL client tools
|
|
1093
1111
|
export POSTGRES_BIN=/usr/lib/postgresql/16/bin
|
|
1094
1112
|
|
|
1095
|
-
odoo-compose
|
|
1113
|
+
odoo-compose venv backup-db
|
|
1096
1114
|
```
|
|
1097
1115
|
|
|
1098
|
-
**Native PostgreSQL configuration:** The database name comes from `[config].db_name` in `odoo-project.ini`; if missing, provisioning generates a workspace-specific name and saves it there. Connection details come from `[config]` or the standard `PG*` environment variables (`PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, etc.), with `.pgpass` also supported. By default, client executables are found through `PATH`; `POSTGRES_BIN` selects their directory (`pg_dump`, `pg_restore`, `psql`, `createdb`, `dropdb`) for `odoo-compose
|
|
1116
|
+
**Native PostgreSQL configuration:** The database name comes from `[config].db_name` in `odoo-project.ini`; if missing, provisioning generates a workspace-specific name and saves it there. Connection details come from `[config]` or the standard `PG*` environment variables (`PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, etc.), with `.pgpass` also supported. By default, client executables are found through `PATH`; `POSTGRES_BIN` selects their directory (`pg_dump`, `pg_restore`, `psql`, `createdb`, `dropdb`) for `odoo-compose venv` only, at command runtime.
|
|
1099
1117
|
|
|
1100
1118
|
For Docker, the database name defaults to `odoo` when not specified.
|
|
1101
1119
|
|
|
@@ -1106,7 +1124,7 @@ Restore a PostgreSQL custom-format dump into `[config].db_name` (Docker defaults
|
|
|
1106
1124
|
**Usage**
|
|
1107
1125
|
|
|
1108
1126
|
```text
|
|
1109
|
-
{odoo-compose|odoo-compose
|
|
1127
|
+
{odoo-compose|odoo-compose venv} restore-db [--root ROOT] [--force] [--copy|--move] BACKUP.dump
|
|
1110
1128
|
```
|
|
1111
1129
|
|
|
1112
1130
|
**Arguments**
|
|
@@ -1138,16 +1156,16 @@ Restore a PostgreSQL custom-format dump into `[config].db_name` (Docker defaults
|
|
|
1138
1156
|
|
|
1139
1157
|
```bash
|
|
1140
1158
|
# Docker workflow:
|
|
1141
|
-
odoo-compose restore-db ./odoo-backups/pre-upgrade.dump
|
|
1142
|
-
odoo-compose restore-db --force --copy ./odoo-backups/pre-upgrade.dump
|
|
1143
|
-
odoo-compose restore-db --move ./odoo-backups/pre-upgrade.dump
|
|
1159
|
+
odoo-compose docker restore-db ./odoo-backups/pre-upgrade.dump
|
|
1160
|
+
odoo-compose docker restore-db --force --copy ./odoo-backups/pre-upgrade.dump
|
|
1161
|
+
odoo-compose docker restore-db --move ./odoo-backups/pre-upgrade.dump
|
|
1144
1162
|
|
|
1145
1163
|
# Native only: optionally override PostgreSQL client location
|
|
1146
1164
|
export POSTGRES_BIN=/usr/lib/postgresql/16/bin
|
|
1147
1165
|
|
|
1148
|
-
odoo-compose
|
|
1149
|
-
odoo-compose
|
|
1150
|
-
odoo-compose
|
|
1166
|
+
odoo-compose venv restore-db ./odoo-backups/pre-upgrade.dump
|
|
1167
|
+
odoo-compose venv restore-db --force --copy ./odoo-backups/pre-upgrade.dump
|
|
1168
|
+
odoo-compose venv restore-db --move ./odoo-backups/pre-upgrade.dump
|
|
1151
1169
|
```
|
|
1152
1170
|
|
|
1153
1171
|
An existing target database is never replaced without `--force`. For native connection and client configuration, see [`backup-db`](#backup-db).
|
|
@@ -1159,7 +1177,7 @@ Archive the selected database's filestore as a `.tar.gz` file.
|
|
|
1159
1177
|
**Usage**
|
|
1160
1178
|
|
|
1161
1179
|
```text
|
|
1162
|
-
{odoo-compose|odoo-compose
|
|
1180
|
+
{odoo-compose|odoo-compose venv} backup-filestore [--root ROOT] [OUTPUT]
|
|
1163
1181
|
```
|
|
1164
1182
|
|
|
1165
1183
|
**Arguments**
|
|
@@ -1182,10 +1200,10 @@ Archive the selected database's filestore as a `.tar.gz` file.
|
|
|
1182
1200
|
|
|
1183
1201
|
```bash
|
|
1184
1202
|
# Docker workflow:
|
|
1185
|
-
odoo-compose backup-filestore
|
|
1203
|
+
odoo-compose docker backup-filestore
|
|
1186
1204
|
|
|
1187
1205
|
# Native workflow:
|
|
1188
|
-
odoo-compose
|
|
1206
|
+
odoo-compose venv backup-filestore
|
|
1189
1207
|
```
|
|
1190
1208
|
|
|
1191
1209
|
For native workspaces, the filestore path comes from `[config].data_dir` or defaults to `ROOT/odoo-data`. Docker accesses the filestore through a one-off Odoo container.
|
|
@@ -1197,7 +1215,7 @@ Restore the selected database's filestore from a `.tar.gz` archive. Stop Odoo be
|
|
|
1197
1215
|
**Usage**
|
|
1198
1216
|
|
|
1199
1217
|
```text
|
|
1200
|
-
{odoo-compose|odoo-compose
|
|
1218
|
+
{odoo-compose|odoo-compose venv} restore-filestore [--root ROOT] [--force] FILESTORE.tar.gz
|
|
1201
1219
|
```
|
|
1202
1220
|
|
|
1203
1221
|
**Arguments**
|
|
@@ -1223,12 +1241,12 @@ Restore the selected database's filestore from a `.tar.gz` archive. Stop Odoo be
|
|
|
1223
1241
|
|
|
1224
1242
|
```bash
|
|
1225
1243
|
# Docker workflow:
|
|
1226
|
-
odoo-compose restore-filestore ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1227
|
-
odoo-compose restore-filestore --force ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1244
|
+
odoo-compose docker restore-filestore ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1245
|
+
odoo-compose docker restore-filestore --force ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1228
1246
|
|
|
1229
1247
|
# Native workflow:
|
|
1230
|
-
odoo-compose
|
|
1231
|
-
odoo-compose
|
|
1248
|
+
odoo-compose venv restore-filestore ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1249
|
+
odoo-compose venv restore-filestore --force ./odoo-backups/pre-upgrade-filestore.tar.gz
|
|
1232
1250
|
```
|
|
1233
1251
|
|
|
1234
1252
|
For native workspaces, the filestore path comes from `[config].data_dir` or defaults to `ROOT/odoo-data`. Docker accesses the filestore through a one-off Odoo container.
|
|
@@ -1240,7 +1258,7 @@ Run Restic against the configured repository. Restic supports incremental filest
|
|
|
1240
1258
|
**Usage**
|
|
1241
1259
|
|
|
1242
1260
|
```text
|
|
1243
|
-
{odoo-compose|odoo-compose
|
|
1261
|
+
{odoo-compose|odoo-compose venv} restic [--root ROOT] RESTIC_COMMAND [ARGS...]
|
|
1244
1262
|
```
|
|
1245
1263
|
|
|
1246
1264
|
**Arguments**
|
|
@@ -1269,19 +1287,19 @@ export RESTIC_REPOSITORY=/srv/restic/odoo
|
|
|
1269
1287
|
export RESTIC_PASSWORD_FILE=/etc/restic/odoo-password
|
|
1270
1288
|
|
|
1271
1289
|
# Docker workflow:
|
|
1272
|
-
odoo-compose restic init
|
|
1273
|
-
odoo-compose restic snapshots
|
|
1274
|
-
odoo-compose restic check
|
|
1290
|
+
odoo-compose docker restic init
|
|
1291
|
+
odoo-compose docker restic snapshots
|
|
1292
|
+
odoo-compose docker restic check
|
|
1275
1293
|
|
|
1276
1294
|
# Native only: select a Restic executable instead of using PATH
|
|
1277
1295
|
export RESTIC_BIN=/opt/restic/restic
|
|
1278
1296
|
|
|
1279
|
-
odoo-compose
|
|
1280
|
-
odoo-compose
|
|
1281
|
-
odoo-compose
|
|
1297
|
+
odoo-compose venv restic init
|
|
1298
|
+
odoo-compose venv restic snapshots
|
|
1299
|
+
odoo-compose venv restic check
|
|
1282
1300
|
```
|
|
1283
1301
|
|
|
1284
|
-
**Configuration:** Set `RESTIC_REPOSITORY` and either `RESTIC_PASSWORD_FILE` or `RESTIC_PASSWORD`. Docker invokes Restic in a one-off container and bind-mounts an absolute local host repository; remote Restic repositories are also supported. For native workspaces, Restic is found through `PATH` by default; `RESTIC_BIN` sets the executable path at command runtime and applies only to `odoo-compose
|
|
1302
|
+
**Configuration:** Set `RESTIC_REPOSITORY` and either `RESTIC_PASSWORD_FILE` or `RESTIC_PASSWORD`. Docker invokes Restic in a one-off container and bind-mounts an absolute local host repository; remote Restic repositories are also supported. For native workspaces, Restic is found through `PATH` by default; `RESTIC_BIN` sets the executable path at command runtime and applies only to `odoo-compose venv`.
|
|
1285
1303
|
|
|
1286
1304
|
### `backup-filestore-restic`
|
|
1287
1305
|
|
|
@@ -1290,7 +1308,7 @@ Back up the selected database's filestore as a Restic snapshot.
|
|
|
1290
1308
|
**Usage**
|
|
1291
1309
|
|
|
1292
1310
|
```text
|
|
1293
|
-
{odoo-compose|odoo-compose
|
|
1311
|
+
{odoo-compose|odoo-compose venv} backup-filestore-restic [--root ROOT] [RESTIC_ARGS...]
|
|
1294
1312
|
```
|
|
1295
1313
|
|
|
1296
1314
|
**Arguments**
|
|
@@ -1313,12 +1331,12 @@ Back up the selected database's filestore as a Restic snapshot.
|
|
|
1313
1331
|
|
|
1314
1332
|
```bash
|
|
1315
1333
|
# Docker workflow:
|
|
1316
|
-
odoo-compose backup-filestore-restic
|
|
1334
|
+
odoo-compose docker backup-filestore-restic
|
|
1317
1335
|
|
|
1318
1336
|
# Native only: optional Restic executable override
|
|
1319
1337
|
export RESTIC_BIN=/opt/restic/restic
|
|
1320
1338
|
|
|
1321
|
-
odoo-compose
|
|
1339
|
+
odoo-compose venv backup-filestore-restic
|
|
1322
1340
|
```
|
|
1323
1341
|
|
|
1324
1342
|
Set the repository and password as described under [`restic`](#restic). Snapshots are tagged `odoo`, `filestore` and `db:<database>`. Set `RESTIC_BACKUP_ID` for an additional `backup-id:<value>` tag; `RESTIC_HOST` overrides the default host used to group snapshots.
|
|
@@ -1330,7 +1348,7 @@ Restore the selected database's filestore from a Restic snapshot. Stop Odoo befo
|
|
|
1330
1348
|
**Usage**
|
|
1331
1349
|
|
|
1332
1350
|
```text
|
|
1333
|
-
{odoo-compose|odoo-compose
|
|
1351
|
+
{odoo-compose|odoo-compose venv} restore-filestore-restic [--root ROOT] [--force] [SNAPSHOT]
|
|
1334
1352
|
```
|
|
1335
1353
|
|
|
1336
1354
|
**Arguments**
|
|
@@ -1356,10 +1374,10 @@ Restore the selected database's filestore from a Restic snapshot. Stop Odoo befo
|
|
|
1356
1374
|
|
|
1357
1375
|
```bash
|
|
1358
1376
|
# Docker workflow:
|
|
1359
|
-
odoo-compose restore-filestore-restic --force latest
|
|
1377
|
+
odoo-compose docker restore-filestore-restic --force latest
|
|
1360
1378
|
|
|
1361
1379
|
# Native workflow:
|
|
1362
|
-
odoo-compose
|
|
1380
|
+
odoo-compose venv restore-filestore-restic --force latest
|
|
1363
1381
|
```
|
|
1364
1382
|
|
|
1365
1383
|
Set `RESTIC_SOURCE_DB_NAME` to restore a snapshot belonging to another database. When selecting `latest`, snapshot lookup also filters by host and the original filestore path. For repository configuration, host/tag settings and `RESTIC_BIN`, see [`restic`](#restic) and [`backup-filestore-restic`](#backup-filestore-restic).
|
|
@@ -1371,7 +1389,7 @@ Neutralize a restored production database for development or testing, then execu
|
|
|
1371
1389
|
**Usage**
|
|
1372
1390
|
|
|
1373
1391
|
```text
|
|
1374
|
-
{odoo-compose|odoo-compose
|
|
1392
|
+
{odoo-compose|odoo-compose venv} neutralize [--root ROOT] [--dry-run [OUTPUT_DIR]]
|
|
1375
1393
|
```
|
|
1376
1394
|
|
|
1377
1395
|
**Options**
|
|
@@ -1389,14 +1407,14 @@ Neutralize a restored production database for development or testing, then execu
|
|
|
1389
1407
|
|
|
1390
1408
|
```bash
|
|
1391
1409
|
# Docker workflow:
|
|
1392
|
-
odoo-compose neutralize
|
|
1393
|
-
odoo-compose neutralize --dry-run
|
|
1394
|
-
odoo-compose neutralize --dry-run ./preview-sql
|
|
1410
|
+
odoo-compose docker neutralize
|
|
1411
|
+
odoo-compose docker neutralize --dry-run
|
|
1412
|
+
odoo-compose docker neutralize --dry-run ./preview-sql
|
|
1395
1413
|
|
|
1396
1414
|
# Native workflow:
|
|
1397
|
-
odoo-compose
|
|
1398
|
-
odoo-compose
|
|
1399
|
-
odoo-compose
|
|
1415
|
+
odoo-compose venv neutralize
|
|
1416
|
+
odoo-compose venv neutralize --dry-run
|
|
1417
|
+
odoo-compose venv neutralize --dry-run ./preview-sql
|
|
1400
1418
|
```
|
|
1401
1419
|
|
|
1402
1420
|
**Odoo versions:** For Odoo 16.0+, the command uses Odoo's built-in neutralization and installed modules' `neutralize.sql` scripts to disable or redirect supported production-side effects (including scheduled actions, outgoing email and external integrations). For Odoo 13.0–15.0, it uses compatibility neutralization of scheduled actions and outgoing/incoming mail servers: Docker uses the Odoo ORM and Venv uses PostgreSQL commands.
|
|
@@ -1444,17 +1462,17 @@ Neutralization is a separate step after restoring the database and filestore:
|
|
|
1444
1462
|
```bash
|
|
1445
1463
|
# Docker workflow:
|
|
1446
1464
|
docker compose stop odoo
|
|
1447
|
-
odoo-compose restore-db --copy ./odoo-backups/production.dump
|
|
1448
|
-
odoo-compose restore-filestore ./odoo-backups/production-filestore.tar.gz
|
|
1449
|
-
odoo-compose update --all
|
|
1450
|
-
odoo-compose neutralize
|
|
1465
|
+
odoo-compose docker restore-db --copy ./odoo-backups/production.dump
|
|
1466
|
+
odoo-compose docker restore-filestore ./odoo-backups/production-filestore.tar.gz
|
|
1467
|
+
odoo-compose docker update --all
|
|
1468
|
+
odoo-compose docker neutralize
|
|
1451
1469
|
docker compose up -d odoo
|
|
1452
1470
|
|
|
1453
1471
|
# Native workflow:
|
|
1454
|
-
odoo-compose
|
|
1455
|
-
odoo-compose
|
|
1456
|
-
odoo-compose
|
|
1457
|
-
odoo-compose
|
|
1472
|
+
odoo-compose venv restore-db --copy ./odoo-backups/production.dump
|
|
1473
|
+
odoo-compose venv restore-filestore ./odoo-backups/production-filestore.tar.gz
|
|
1474
|
+
odoo-compose venv update --all
|
|
1475
|
+
odoo-compose venv neutralize
|
|
1458
1476
|
```
|
|
1459
1477
|
|
|
1460
1478
|
The Docker example uses `docker compose stop odoo` and `docker compose up -d odoo` intentionally: only the Odoo service is stopped and restarted, while PostgreSQL remains available for the restore operations.
|
|
@@ -1466,7 +1484,7 @@ Generate shell-completion definitions for either CLI. See [Shell completion](#sh
|
|
|
1466
1484
|
**Usage**
|
|
1467
1485
|
|
|
1468
1486
|
```text
|
|
1469
|
-
{odoo-compose|odoo-compose
|
|
1487
|
+
{odoo-compose|odoo-compose venv} completion {bash|zsh|fish|powershell}
|
|
1470
1488
|
```
|
|
1471
1489
|
|
|
1472
1490
|
**Arguments**
|
|
@@ -1536,7 +1554,7 @@ db_password = odoo
|
|
|
1536
1554
|
CLI override example:
|
|
1537
1555
|
|
|
1538
1556
|
```bash
|
|
1539
|
-
odoo-compose
|
|
1557
|
+
odoo-compose venv setup odoo-project.ini --sync-all --create-venv -e branch=dev -e db=odoo_dev
|
|
1540
1558
|
```
|
|
1541
1559
|
|
|
1542
1560
|
### `[virtualenv]`
|
|
@@ -1678,7 +1696,7 @@ target = /mnt/exchange
|
|
|
1678
1696
|
The same share can be configured through the CLI:
|
|
1679
1697
|
|
|
1680
1698
|
```bash
|
|
1681
|
-
odoo-compose setup \
|
|
1699
|
+
odoo-compose docker setup \
|
|
1682
1700
|
--set docker.share.exchange:source=/mnt/nfs/exchange \
|
|
1683
1701
|
--set docker.share.exchange:target=/mnt/exchange
|
|
1684
1702
|
```
|
|
@@ -1689,7 +1707,7 @@ This section is optional.
|
|
|
1689
1707
|
|
|
1690
1708
|
When present, it contains Odoo server configuration values written into `ROOT/odoo-configs/odoo-server.conf`.
|
|
1691
1709
|
|
|
1692
|
-
For `odoo-compose
|
|
1710
|
+
For `odoo-compose venv`, omitting `[config]` still generates a valid config file with generated values such as `addons_path` and `data_dir`. The Docker workflow does not generate `odoo-server.conf`.
|
|
1693
1711
|
|
|
1694
1712
|
You can define standard Odoo configuration options here.
|
|
1695
1713
|
|
|
@@ -1709,3 +1727,22 @@ db_user = odoo
|
|
|
1709
1727
|
db_password = odoo
|
|
1710
1728
|
http_port = 8069
|
|
1711
1729
|
```
|
|
1730
|
+
|
|
1731
|
+
---
|
|
1732
|
+
|
|
1733
|
+
## Running tests
|
|
1734
|
+
|
|
1735
|
+
From the repository root:
|
|
1736
|
+
|
|
1737
|
+
Install the test dependency with `python -m pip install -e ".[test]"`, then run:
|
|
1738
|
+
|
|
1739
|
+
```bash
|
|
1740
|
+
pytest # All available tests
|
|
1741
|
+
pytest -m "not integration" # Fast tests only
|
|
1742
|
+
pytest -m integration # Integration tests only
|
|
1743
|
+
pytest tests/test_git.py # Specific test file
|
|
1744
|
+
```
|
|
1745
|
+
|
|
1746
|
+
Integration tests use Docker to prepare Odoo and PostgreSQL automatically.
|
|
1747
|
+
Unavailable platform-specific tests are reported as `SKIP`.
|
|
1748
|
+
GitHub Actions uses the same pytest commands. See [tests/README.md](tests/README.md).
|