odoo-devops-tools 1.19.2__tar.gz → 1.19.4__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.19.2 → odoo_devops_tools-1.19.4}/PKG-INFO +228 -204
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/README.md +227 -203
- odoo_devops_tools-1.19.4/odoo_devops_tools/__init__.py +1 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools/env.py +1 -14
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools.egg-info/PKG-INFO +228 -204
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/pyproject.toml +1 -1
- odoo_devops_tools-1.19.2/odoo_devops_tools/__init__.py +0 -1
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/LICENSE +0 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools.egg-info/SOURCES.txt +0 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools.egg-info/dependency_links.txt +0 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools.egg-info/entry_points.txt +0 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/odoo_devops_tools.egg-info/top_level.txt +0 -0
- {odoo_devops_tools-1.19.2 → odoo_devops_tools-1.19.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.19.
|
|
3
|
+
Version: 1.19.4
|
|
4
4
|
Summary: A small set of utilities for local Odoo development and simple Odoo deployments.
|
|
5
5
|
Author: Roman Lacko
|
|
6
6
|
License-Expression: MIT
|
|
@@ -28,33 +28,61 @@ Dynamic: license-file
|
|
|
28
28
|
|
|
29
29
|
# odoo-devops-tools
|
|
30
30
|
|
|
31
|
-
**
|
|
31
|
+
**Manage reproducible Odoo workspaces.**
|
|
32
32
|
|
|
33
|
-
`odoo-devops-tools`
|
|
34
|
-
|
|
33
|
+
`odoo-devops-tools` provides **`odt-env`**, a CLI for creating reproducible Odoo workspaces from a single configuration file.
|
|
34
|
+
|
|
35
|
+
A basic workspace definition with addons can look like this:
|
|
36
|
+
|
|
37
|
+
```ini
|
|
38
|
+
[odoo]
|
|
39
|
+
version = 19.0
|
|
40
|
+
|
|
41
|
+
[addons.oca-web]
|
|
42
|
+
repo = https://github.com/OCA/web.git
|
|
43
|
+
branch = ${odoo:version}
|
|
44
|
+
|
|
45
|
+
[addons.oca-helpdesk]
|
|
46
|
+
repo = https://github.com/OCA/helpdesk.git
|
|
47
|
+
branch = ${odoo:version}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
From this configuration, `odt-env` can generate a workspace such as:
|
|
35
51
|
|
|
36
52
|
```text
|
|
37
53
|
ROOT/
|
|
38
|
-
├── odoo/
|
|
39
|
-
├── odoo-addons/
|
|
40
|
-
├──
|
|
41
|
-
|
|
42
|
-
├── odoo-
|
|
43
|
-
├── odoo-
|
|
44
|
-
├── odoo-
|
|
45
|
-
├──
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
├──
|
|
49
|
-
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
52
|
-
├──
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
├── odoo/ # Odoo source
|
|
55
|
+
├── odoo-addons/ # addon sources
|
|
56
|
+
│ ├── oca-web/
|
|
57
|
+
│ └── oca-helpdesk/
|
|
58
|
+
├── odoo-configs/ # generated Odoo configuration
|
|
59
|
+
├── odoo-scripts/ # run, test, shell, backup, restore, update
|
|
60
|
+
├── odoo-data/ # Odoo data directory
|
|
61
|
+
├── odoo-logs/ # runtime logs
|
|
62
|
+
├── odoo-backups/ # backups created by helper scripts
|
|
63
|
+
├── docker/ # generated Docker artifacts
|
|
64
|
+
│ ├── local/ # local-development build context
|
|
65
|
+
│ └── deploy/ # self-contained deploy build context, when requested
|
|
66
|
+
├── wheelhouse/ # offline Python wheelhouse
|
|
67
|
+
├── venv/ # Python virtual environment
|
|
68
|
+
├── dist/ # portable workspace bundles, when requested
|
|
69
|
+
├── compose.yaml # local-development Docker Compose file
|
|
70
|
+
├── odoo-project.ini # workspace configuration
|
|
71
|
+
└── .odt-env/ # provisioning metadata and snapshots
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Key features
|
|
75
|
+
|
|
76
|
+
- **Reproducible Odoo workspaces** — define the workspace in a single INI configuration file and recreate generated artifacts when needed.
|
|
77
|
+
- **Flexible addon sources** — use Git repositories or local addon directories, with optional branch and commit pinning.
|
|
78
|
+
- **Consistent Python dependencies** — manage Python versions, virtual environments, requirements, overrides, and build constraints with `uv`.
|
|
79
|
+
- **Docker development** — generate a local Docker Compose environment with PostgreSQL and bind-mounted addon sources.
|
|
80
|
+
- **Docker deployment artifacts** — generate a self-contained Docker build context for use in existing CI/CD pipelines.
|
|
81
|
+
- **Portable and offline workflows** — create verified bundles containing sources and Python wheels for reproducible or disconnected environments.
|
|
82
|
+
- **Composable configuration** — combine multiple INI files, reusable variables, and CLI overrides.
|
|
83
|
+
- **Minimal Python footprint** — `odt-env` is implemented using only the Python standard library and has no third-party Python package dependencies.
|
|
84
|
+
|
|
85
|
+
`odt-env` focuses on creating and maintaining the Odoo workspace and its derived artifacts. Infrastructure provisioning and deployment orchestration remain outside its scope.
|
|
58
86
|
|
|
59
87
|
---
|
|
60
88
|
|
|
@@ -62,7 +90,7 @@ offline installs, or lightweight deployment artifacts that can be used directly
|
|
|
62
90
|
|
|
63
91
|
- **git**: https://git-scm.com/install/
|
|
64
92
|
- **uv**: https://docs.astral.sh/uv/getting-started/installation/
|
|
65
|
-
- **Docker**: https://docs.docker.com/get-docker/ — optional,
|
|
93
|
+
- **Docker**: https://docs.docker.com/get-docker/ — optional, for Docker workflows.
|
|
66
94
|
|
|
67
95
|
---
|
|
68
96
|
|
|
@@ -84,11 +112,35 @@ odt-env --help
|
|
|
84
112
|
|
|
85
113
|
## Quick start
|
|
86
114
|
|
|
87
|
-
|
|
115
|
+
`odt-env` supports two alternative local development workflows:
|
|
116
|
+
|
|
117
|
+
- **Docker development** — run Odoo and PostgreSQL with Docker Compose.
|
|
118
|
+
- **Native development with venv** — run Odoo directly on the host using a generated Python virtual environment.
|
|
119
|
+
|
|
120
|
+
Choose the workflow that fits your development environment. Both use the same `odoo-project.ini` project definition.
|
|
121
|
+
|
|
122
|
+
### Docker development
|
|
123
|
+
|
|
124
|
+
Create a new workspace and start it with Docker Compose:
|
|
88
125
|
|
|
89
126
|
```bash
|
|
90
|
-
odt-env --init-project --root ./
|
|
91
|
-
|
|
127
|
+
odt-env --init-project --root ./odoo19
|
|
128
|
+
cd ./odoo19
|
|
129
|
+
docker compose up
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`odt-env` creates the project definition and generates the local Docker build context and `compose.yaml`. The default project does not contain any extra addon sources, so no repository sync is needed for this first Docker start. Docker Compose then starts both Odoo and PostgreSQL.
|
|
133
|
+
|
|
134
|
+
Open http://localhost:8069.
|
|
135
|
+
|
|
136
|
+
### Native development with venv
|
|
137
|
+
|
|
138
|
+
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
139
|
+
|
|
140
|
+
Create the workspace with the Odoo source and virtual environment:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
odt-env --init-project --root ./odoo19 --sync-all --create-venv \
|
|
92
144
|
--set config:db_host=127.0.0.1 \
|
|
93
145
|
--set config:db_name=odoo \
|
|
94
146
|
--set config:db_user=odoo \
|
|
@@ -101,7 +153,7 @@ odt-env --init-project --root ./odoo18-workspace --sync-all --create-venv \
|
|
|
101
153
|
Start Odoo with the generated script:
|
|
102
154
|
|
|
103
155
|
```bash
|
|
104
|
-
cd
|
|
156
|
+
cd ./odoo19
|
|
105
157
|
./odoo-scripts/run.sh
|
|
106
158
|
```
|
|
107
159
|
|
|
@@ -111,9 +163,9 @@ Odoo starts with the generated configuration from `./odoo-configs/odoo-server.co
|
|
|
111
163
|
|
|
112
164
|
## Usage
|
|
113
165
|
|
|
114
|
-
The examples below
|
|
166
|
+
The examples below use the same workspace configuration introduced in the Quick start section. Docker-specific and native-specific steps are separated where they differ.
|
|
115
167
|
|
|
116
|
-
The
|
|
168
|
+
The default `odoo-project.ini` contains:
|
|
117
169
|
|
|
118
170
|
```ini
|
|
119
171
|
[virtualenv]
|
|
@@ -124,23 +176,21 @@ requirements =
|
|
|
124
176
|
requirements_ignore =
|
|
125
177
|
|
|
126
178
|
[odoo]
|
|
127
|
-
version =
|
|
179
|
+
version = 19.0
|
|
128
180
|
repo = https://github.com/odoo/odoo.git
|
|
129
|
-
branch =
|
|
181
|
+
branch = 19.0
|
|
130
182
|
commit =
|
|
131
183
|
shallow = true
|
|
132
184
|
|
|
133
185
|
[docker]
|
|
134
|
-
base_image = odoo:
|
|
186
|
+
base_image = odoo:19.0
|
|
135
187
|
|
|
136
188
|
[config]
|
|
137
|
-
db_host = 127.0.0.1
|
|
138
|
-
db_name = odoo
|
|
139
|
-
db_user = odoo
|
|
140
|
-
db_password = odoo
|
|
141
189
|
```
|
|
142
190
|
|
|
143
|
-
|
|
191
|
+
The local Docker workflow can use this configuration as-is. The native quick start adds the PostgreSQL connection settings to `[config]` through `--set`.
|
|
192
|
+
|
|
193
|
+
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
144
194
|
|
|
145
195
|
### 1. Adding extra addons
|
|
146
196
|
|
|
@@ -164,65 +214,111 @@ branch = ${odoo:version}
|
|
|
164
214
|
|
|
165
215
|
The rest of the generated project file can stay unchanged.
|
|
166
216
|
|
|
167
|
-
#### 1.2.
|
|
217
|
+
#### 1.2. Docker development
|
|
168
218
|
|
|
169
|
-
|
|
219
|
+
Sync the configured addon repositories and refresh the generated local Docker artifacts:
|
|
170
220
|
|
|
171
221
|
```bash
|
|
172
|
-
odt-env --sync-
|
|
222
|
+
odt-env --sync-addons
|
|
223
|
+
docker compose up --build -d
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The addon repositories are cloned into `ROOT/odoo-addons/oca-web/` and `ROOT/odoo-addons/oca-helpdesk/` and bind-mounted into the Odoo container.
|
|
227
|
+
|
|
228
|
+
If an addon source contains a `requirements.txt` file, its Python dependencies are included when the local Docker image is rebuilt.
|
|
229
|
+
|
|
230
|
+
Install the modules from the newly added addon repositories:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
docker compose run --rm odoo \
|
|
234
|
+
-- \
|
|
235
|
+
-c /etc/odoo/odoo.conf \
|
|
236
|
+
-d odoo \
|
|
237
|
+
-i web_notify,helpdesk_mgmt \
|
|
238
|
+
--without-demo=all \
|
|
239
|
+
--stop-after-init
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
For subsequent addon updates, run `click-odoo-update` inside the Odoo container:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
docker compose exec odoo click-odoo-update \
|
|
246
|
+
-c /etc/odoo/odoo.conf \
|
|
247
|
+
-d odoo
|
|
173
248
|
```
|
|
174
249
|
|
|
175
|
-
|
|
250
|
+
#### 1.3. Native development with venv
|
|
176
251
|
|
|
177
|
-
|
|
252
|
+
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
178
253
|
|
|
179
|
-
|
|
254
|
+
```bash
|
|
255
|
+
odt-env --sync-all --create-venv
|
|
256
|
+
```
|
|
180
257
|
|
|
181
|
-
|
|
258
|
+
The addon repositories are cloned into `ROOT/odoo-addons/oca-web/` and `ROOT/odoo-addons/oca-helpdesk/`, and their directories are added to the generated `addons_path`.
|
|
182
259
|
|
|
183
|
-
|
|
260
|
+
Start Odoo and install the modules from the newly added addon repositories:
|
|
184
261
|
|
|
185
262
|
```bash
|
|
186
263
|
./odoo-scripts/run.sh -i web_notify,helpdesk_mgmt
|
|
187
264
|
```
|
|
188
265
|
|
|
189
|
-
|
|
266
|
+
For subsequent addon updates, use the generated update script:
|
|
190
267
|
|
|
191
|
-
|
|
268
|
+
```bash
|
|
269
|
+
./odoo-scripts/update.sh
|
|
270
|
+
```
|
|
192
271
|
|
|
193
|
-
|
|
272
|
+
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
194
273
|
|
|
195
|
-
|
|
274
|
+
---
|
|
196
275
|
|
|
197
|
-
|
|
276
|
+
### 2. Creating a Docker deploy build context
|
|
198
277
|
|
|
199
|
-
|
|
278
|
+
Use `--create-docker-deploy` to generate a self-contained Docker build context for CI/CD, testing, staging, production, or another non-local deployment workflow.
|
|
200
279
|
|
|
201
|
-
|
|
202
|
-
> Set `python_version` to the Python version you want to use from your local system.
|
|
203
|
-
> In the example below, 3.11 is only illustrative.
|
|
280
|
+
Addon modules are staged into the build context so the resulting image does not depend on bind-mounted workspace sources:
|
|
204
281
|
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
managed_python = false
|
|
208
|
-
python_version = 3.11
|
|
282
|
+
```bash
|
|
283
|
+
odt-env --sync-addons --create-docker-deploy
|
|
209
284
|
```
|
|
210
285
|
|
|
211
|
-
|
|
286
|
+
This additionally creates:
|
|
212
287
|
|
|
213
|
-
|
|
288
|
+
```text
|
|
289
|
+
ROOT/docker/deploy/
|
|
290
|
+
├── Dockerfile
|
|
291
|
+
├── .dockerignore
|
|
292
|
+
├── addons/
|
|
293
|
+
├── requirements/
|
|
294
|
+
└── configs/
|
|
295
|
+
└── odoo.conf
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Addon modules are staged under `docker/deploy/addons/` and copied into `/mnt/extra-addons/` by the generated Dockerfile. Runtime Compose configuration is not generated for the deploy context.
|
|
299
|
+
|
|
300
|
+
`odt-env` prepares the deploy build context but does not build or push the image. Build it with Docker or your CI/CD system, for example:
|
|
214
301
|
|
|
215
302
|
```bash
|
|
216
|
-
|
|
303
|
+
docker build -t mycompany/odoo:19.0 docker/deploy
|
|
217
304
|
```
|
|
218
305
|
|
|
219
|
-
|
|
306
|
+
`[docker].base_image` controls the base image used by both local and deploy Dockerfiles.
|
|
307
|
+
|
|
308
|
+
In CI, where the local development context is unnecessary, combine the options:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
odt-env --sync-addons --create-docker-deploy --no-local-docker
|
|
312
|
+
docker build -t mycompany/odoo:19.0 docker/deploy
|
|
313
|
+
```
|
|
220
314
|
|
|
221
315
|
---
|
|
222
316
|
|
|
223
317
|
### 3. Managing Python requirements
|
|
224
318
|
|
|
225
|
-
The `[virtualenv]` section
|
|
319
|
+
The `[virtualenv]` section controls additional Python dependencies used when provisioning both the native virtual environment and generated Docker images.
|
|
320
|
+
|
|
321
|
+
Use it to add new packages, pin specific versions, and override packages collected from Odoo or addon repository `requirements.txt` files.
|
|
226
322
|
|
|
227
323
|
Use:
|
|
228
324
|
|
|
@@ -242,7 +338,7 @@ requirements =
|
|
|
242
338
|
boto3==1.35.99
|
|
243
339
|
```
|
|
244
340
|
|
|
245
|
-
In this example, both packages are
|
|
341
|
+
In this example, both packages are included in the generated dependency set and pinned to the specified versions.
|
|
246
342
|
|
|
247
343
|
#### 3.2. Override a package with a different one
|
|
248
344
|
|
|
@@ -262,9 +358,43 @@ In this example, `odt-env` installs `psycopg2-binary==2.9.9` and skips `psycopg2
|
|
|
262
358
|
|
|
263
359
|
---
|
|
264
360
|
|
|
265
|
-
### 4.
|
|
361
|
+
### 4. Using system Python instead of managed Python
|
|
362
|
+
|
|
363
|
+
By default, `odt-env` uses `uv` to install and manage the requested Python version.
|
|
364
|
+
|
|
365
|
+
If you already have a suitable system Python installed, you can disable managed Python.
|
|
366
|
+
|
|
367
|
+
#### 4.1. Update the project file
|
|
368
|
+
|
|
369
|
+
Disable managed Python by adding `python_version = 3.11` and `managed_python = false` to the `odoo-project.ini` file.
|
|
370
|
+
|
|
371
|
+
> **Note**
|
|
372
|
+
> Set `python_version` to the Python version you want to use from your local system.
|
|
373
|
+
> In the example below, 3.11 is only illustrative.
|
|
374
|
+
|
|
375
|
+
```ini
|
|
376
|
+
[virtualenv]
|
|
377
|
+
managed_python = false
|
|
378
|
+
python_version = 3.11
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
#### 4.2. Update the workspace
|
|
382
|
+
|
|
383
|
+
After changing the project file, run `odt-env` again from the workspace root:
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
odt-env --sync-all --create-venv
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
### 5. Creating portable workspace bundles
|
|
394
|
+
|
|
395
|
+
Portable bundles are useful when you want to prepare an Odoo workspace on an internet-connected machine and reproduce it on another compatible machine without cloning repositories or downloading Python packages again.
|
|
266
396
|
|
|
267
|
-
A portable workspace bundle is a ZIP archive containing
|
|
397
|
+
A portable workspace bundle is a ZIP archive containing:
|
|
268
398
|
|
|
269
399
|
```text
|
|
270
400
|
odoo/
|
|
@@ -275,9 +405,10 @@ odoo-project.ini
|
|
|
275
405
|
```
|
|
276
406
|
|
|
277
407
|
The bundle does not contain the virtual environment, database data, logs, backups, generated scripts, generated configuration files, Docker artifacts, Git metadata, or provisioning history.
|
|
408
|
+
|
|
278
409
|
Those machine-specific outputs are recreated on the target machine.
|
|
279
410
|
|
|
280
|
-
####
|
|
411
|
+
#### 5.1. Create a bundle on the build machine
|
|
281
412
|
|
|
282
413
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
283
414
|
|
|
@@ -297,7 +428,7 @@ You can also select an explicit output file:
|
|
|
297
428
|
odt-env --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
|
|
298
429
|
```
|
|
299
430
|
|
|
300
|
-
####
|
|
431
|
+
#### 5.1.1. Including uncommitted changes
|
|
301
432
|
|
|
302
433
|
By default, bundle creation stops when a bundled Git repository has uncommitted changes.
|
|
303
434
|
|
|
@@ -307,7 +438,7 @@ To intentionally include those changes in the bundle, use:
|
|
|
307
438
|
odt-env --sync-all --create-venv --create-bundle --allow-dirty-bundle
|
|
308
439
|
```
|
|
309
440
|
|
|
310
|
-
####
|
|
441
|
+
#### 5.2. Create the workspace on the target machine
|
|
311
442
|
|
|
312
443
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
313
444
|
|
|
@@ -334,130 +465,16 @@ The import operation:
|
|
|
334
465
|
> **Compatibility note**
|
|
335
466
|
> A wheelhouse is platform- and architecture-dependent. Create and import a bundle on compatible systems, for example Linux x86-64 to Linux x86-64. The target machine must have `uv` and access to the configured Python version. When `[virtualenv].managed_python = true`, `uv` may still need network access if that Python interpreter is not already installed or cached. For a fully disconnected target, install the required Python interpreter beforehand or use `managed_python = false`.
|
|
336
467
|
|
|
337
|
-
####
|
|
468
|
+
#### 5.3. Manual wheelhouse workflow
|
|
338
469
|
|
|
339
470
|
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:
|
|
340
471
|
|
|
341
472
|
```bash
|
|
342
|
-
odt-env --create-venv-from-wheelhouse
|
|
473
|
+
odt-env --create-venv-from-wheelhouse --no-local-docker
|
|
343
474
|
```
|
|
344
475
|
|
|
345
476
|
This recreates `ROOT/venv`, skips dependency compilation and wheelhouse building, and installs strictly from the existing `ROOT/wheelhouse/` and `all-requirements.lock.txt`.
|
|
346
477
|
|
|
347
|
-
### 5. Local Docker development and deploy contexts
|
|
348
|
-
|
|
349
|
-
`odt-env` generates Docker artifacts for two distinct workflows:
|
|
350
|
-
|
|
351
|
-
- `ROOT/docker/local/` is the local-development build context. It is generated by default during normal online workspace provisioning, together with `ROOT/compose.yaml`.
|
|
352
|
-
- `ROOT/docker/deploy/` is a self-contained deployment build context. It is generated only when `--create-docker-deploy` is requested.
|
|
353
|
-
|
|
354
|
-
The local context never copies addon source code into the image. Addon directories are bind-mounted from the workspace so edits on the host are visible inside the running Odoo container. The deploy context does the opposite: it stages addon modules into the build context so the resulting image is self-contained.
|
|
355
|
-
|
|
356
|
-
#### 5.1. Start a local Docker development workspace
|
|
357
|
-
|
|
358
|
-
For example, create an Odoo 19 workspace and sync its configured addons:
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
odt-env --init-project --root ./odoo19 --sync-addons
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
This generates the usual workspace outputs plus:
|
|
365
|
-
|
|
366
|
-
```text
|
|
367
|
-
odoo19/
|
|
368
|
-
├── docker/
|
|
369
|
-
│ └── local/
|
|
370
|
-
│ ├── Dockerfile
|
|
371
|
-
│ ├── .dockerignore
|
|
372
|
-
│ ├── requirements/
|
|
373
|
-
│ └── configs/
|
|
374
|
-
│ └── odoo.conf
|
|
375
|
-
└── compose.yaml
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
Start PostgreSQL and Odoo directly with Docker Compose:
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
cd ./odoo19
|
|
382
|
-
docker compose up
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
The `odoo` service uses `build.context: ./docker/local`, so Compose builds the local image automatically when needed. No separate `odt-env` Docker build command is required.
|
|
386
|
-
|
|
387
|
-
Configured addon sources are mounted into the container under `/mnt/extra-addons/`. For example:
|
|
388
|
-
|
|
389
|
-
```yaml
|
|
390
|
-
services:
|
|
391
|
-
odoo:
|
|
392
|
-
build:
|
|
393
|
-
context: ./docker/local
|
|
394
|
-
volumes:
|
|
395
|
-
- ./docker/local/configs:/etc/odoo:ro
|
|
396
|
-
- type: bind
|
|
397
|
-
source: ./odoo-addons/oca-web
|
|
398
|
-
target: /mnt/extra-addons/oca-web
|
|
399
|
-
- type: bind
|
|
400
|
-
source: ./odoo-addons/oca-helpdesk
|
|
401
|
-
target: /mnt/extra-addons/oca-helpdesk
|
|
402
|
-
- odoo-data:/var/lib/odoo
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
Changes to addon source files on the host are therefore immediately visible inside the running container. Odoo may still need a process restart or a module update depending on the type of change.
|
|
406
|
-
|
|
407
|
-
If an addon `requirements.txt`, `[virtualenv].requirements`, Docker base image, or another image-level dependency changes, rerun `odt-env` to refresh `docker/local/` and then rebuild through Compose:
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
odt-env --sync-addons
|
|
411
|
-
docker compose up --build
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
Local database connection options in `[config]`, such as `db_host = 127.0.0.1`, are for the non-Docker workspace. They are intentionally not copied into `docker/local/configs/odoo.conf`; the local container connects to the generated Compose database service instead.
|
|
415
|
-
|
|
416
|
-
#### 5.2. Skip local Docker generation
|
|
417
|
-
|
|
418
|
-
Local Docker artifacts are generated by default during normal online provisioning, similarly to config files and helper scripts. Disable them explicitly when they are not wanted:
|
|
419
|
-
|
|
420
|
-
```bash
|
|
421
|
-
odt-env --sync-all --create-venv --no-local-docker
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
`--no-local-docker` skips regeneration of `ROOT/docker/local/` and `ROOT/compose.yaml`. Existing files are left in place.
|
|
425
|
-
|
|
426
|
-
#### 5.3. Generate a deploy Docker build context
|
|
427
|
-
|
|
428
|
-
Use `--create-docker-deploy` when you need a self-contained image context for CI/CD, testing, staging, production, or another non-local deployment workflow:
|
|
429
|
-
|
|
430
|
-
```bash
|
|
431
|
-
odt-env --sync-addons --create-docker-deploy
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
This additionally creates:
|
|
435
|
-
|
|
436
|
-
```text
|
|
437
|
-
ROOT/docker/deploy/
|
|
438
|
-
├── Dockerfile
|
|
439
|
-
├── .dockerignore
|
|
440
|
-
├── addons/
|
|
441
|
-
└── requirements/
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
Addon modules are staged under `docker/deploy/addons/` and copied into `/mnt/extra-addons/` by the generated Dockerfile. Runtime Compose configuration is not generated for the deploy context.
|
|
445
|
-
|
|
446
|
-
`odt-env` does not build or push the deploy image. Build it with Docker or your CI/CD system, for example:
|
|
447
|
-
|
|
448
|
-
```bash
|
|
449
|
-
docker build -t mycompany/odoo:19.0 docker/deploy
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
`[docker].base_image` controls the base image used by both local and deploy Dockerfiles.
|
|
453
|
-
|
|
454
|
-
In CI, where the local development context is unnecessary, combine the options:
|
|
455
|
-
|
|
456
|
-
```bash
|
|
457
|
-
odt-env --sync-addons --create-docker-deploy --no-local-docker
|
|
458
|
-
docker build -t mycompany/odoo:19.0 docker/deploy
|
|
459
|
-
```
|
|
460
|
-
|
|
461
478
|
---
|
|
462
479
|
|
|
463
480
|
## Command-line reference
|
|
@@ -503,6 +520,7 @@ If no arguments are specified, `odt-env` prints help and exits.
|
|
|
503
520
|
#### Default project file convention
|
|
504
521
|
|
|
505
522
|
If no positional `INI` file is provided and no `-i/--include` option is used, `odt-env` looks for `ROOT/odoo-project.ini`.
|
|
523
|
+
|
|
506
524
|
This is similar to how Docker Compose uses `compose.yaml` by convention.
|
|
507
525
|
|
|
508
526
|
For example, this command:
|
|
@@ -526,7 +544,9 @@ odt-env odoo-project.ini -i local-overrides.ini -i extra-addons.ini --sync-all -
|
|
|
526
544
|
```
|
|
527
545
|
|
|
528
546
|
Project layers are processed from left to right. Later layers override earlier layers.
|
|
547
|
+
|
|
529
548
|
Validation is performed only after all layers have been merged.
|
|
549
|
+
|
|
530
550
|
The merged project file is saved as `ROOT/odoo-project.ini`.
|
|
531
551
|
|
|
532
552
|
### Paths and outputs
|
|
@@ -534,19 +554,19 @@ The merged project file is saved as `ROOT/odoo-project.ini`.
|
|
|
534
554
|
- `--root ROOT` — workspace root directory. Default: the directory containing a local INI file, or the current working directory for a remote INI or omitted INI. In include mode, the default is the directory of the first local source, or the current working directory when the first source is remote.
|
|
535
555
|
- `--init-project` — create `ROOT/odoo-project.ini` from the bundled default template if it does not already exist. This is only valid when `INI` is omitted and no `-i/--include` is provided. Existing project files are not overwritten.
|
|
536
556
|
- `--include INI`, `-i INI` — include an additional project INI layer; can be repeated. Later layers override earlier layers.
|
|
537
|
-
- `--extra-var KEY=VALUE`, `-e KEY=VALUE` — override or inject a value in the optional `[vars]` section; can be repeated
|
|
557
|
+
- `--extra-var KEY=VALUE`, `-e KEY=VALUE` — override or inject a value in the optional `[vars]` section; can be repeated.
|
|
538
558
|
- `--set SECTION:KEY=VALUE`, `-S SECTION:KEY=VALUE` — override a value that is already present in the INI file; can be repeated. New options are allowed only in the `[config]` section.
|
|
539
|
-
- `--no-configs` — do not generate config files
|
|
540
|
-
- `--no-scripts` — do not generate helper scripts under `ROOT/odoo-scripts
|
|
541
|
-
- `--no-data-dir` — do not create the Odoo data directory
|
|
542
|
-
- `--no-provisioning-log` — do not write provisioning metadata under `ROOT/.odt-env
|
|
543
|
-
- `--show-last-run` — print metadata from `ROOT/.odt-env/last-provisioning.json` and exit without provisioning
|
|
559
|
+
- `--no-configs` — do not generate config files.
|
|
560
|
+
- `--no-scripts` — do not generate helper scripts under `ROOT/odoo-scripts/`.
|
|
561
|
+
- `--no-data-dir` — do not create the Odoo data directory.
|
|
562
|
+
- `--no-provisioning-log` — do not write provisioning metadata under `ROOT/.odt-env/`.
|
|
563
|
+
- `--show-last-run` — print metadata from `ROOT/.odt-env/last-provisioning.json` and exit without provisioning.
|
|
544
564
|
|
|
545
565
|
### Repository sync
|
|
546
566
|
|
|
547
|
-
- `--sync-odoo` — sync only the Git-managed Odoo source; when `[odoo].path` is used, the local path is reused and Git sync is skipped
|
|
548
|
-
- `--sync-addons` — sync only `ROOT/odoo-addons
|
|
549
|
-
- `--sync-all` — sync both Odoo and addons
|
|
567
|
+
- `--sync-odoo` — sync only the Git-managed Odoo source; when `[odoo].path` is used, the local path is reused and Git sync is skipped.
|
|
568
|
+
- `--sync-addons` — sync only `ROOT/odoo-addons/*`.
|
|
569
|
+
- `--sync-all` — sync both Odoo and addons.
|
|
550
570
|
|
|
551
571
|
> **Note**
|
|
552
572
|
> If any target repository contains local uncommitted changes, `odt-env` aborts the sync operation.
|
|
@@ -556,7 +576,7 @@ The merged project file is saved as `ROOT/odoo-project.ini`.
|
|
|
556
576
|
|
|
557
577
|
Online virtual environment provisioning:
|
|
558
578
|
|
|
559
|
-
- `--create-venv` — recreate `ROOT/venv` and refresh the wheelhouse; if `ROOT/venv` already exists, it is deleted and created again
|
|
579
|
+
- `--create-venv` — recreate `ROOT/venv` and refresh the wheelhouse; if `ROOT/venv` already exists, it is deleted and created again.
|
|
560
580
|
|
|
561
581
|
Offline deployment from a prebuilt wheelhouse:
|
|
562
582
|
|
|
@@ -564,7 +584,7 @@ Offline deployment from a prebuilt wheelhouse:
|
|
|
564
584
|
|
|
565
585
|
Maintenance:
|
|
566
586
|
|
|
567
|
-
- `--clear-pip-wheel-cache` — remove all items from pip's wheel cache
|
|
587
|
+
- `--clear-pip-wheel-cache` — remove all items from pip's wheel cache.
|
|
568
588
|
|
|
569
589
|
### Portable workspace bundles
|
|
570
590
|
|
|
@@ -580,7 +600,7 @@ Maintenance:
|
|
|
580
600
|
|
|
581
601
|
### Other options
|
|
582
602
|
|
|
583
|
-
- `--version` — show the installed `odt-env` version and exit
|
|
603
|
+
- `--version` — show the installed `odt-env` version and exit.
|
|
584
604
|
|
|
585
605
|
---
|
|
586
606
|
|
|
@@ -707,14 +727,14 @@ Addon sections are optional. You can define as many as needed.
|
|
|
707
727
|
Each addon must use exactly one of these source types:
|
|
708
728
|
|
|
709
729
|
- local addon path: `path`
|
|
710
|
-
-
|
|
730
|
+
- Git repository: `repo` + `branch` (+ optional `commit` and `shallow`)
|
|
711
731
|
|
|
712
732
|
Rules:
|
|
713
733
|
|
|
714
734
|
- For a local addon, use only `path`.
|
|
715
|
-
- For a
|
|
716
|
-
- `commit` is optional for a
|
|
717
|
-
- `shallow` is optional for
|
|
735
|
+
- For a Git addon, `repo` and `branch` are required.
|
|
736
|
+
- `commit` is optional for a Git addon. When set, the repository is pinned to that exact revision.
|
|
737
|
+
- `shallow` is optional for Git addons and defaults to `true`. It is ignored when `commit` is set.
|
|
718
738
|
- Relative local paths are resolved relative to `ROOT/`.
|
|
719
739
|
- Git-based addons are cloned into `ROOT/odoo-addons/<name>/`.
|
|
720
740
|
- All configured addon directories are automatically appended to the generated `addons_path`.
|
|
@@ -742,6 +762,7 @@ This section is optional.
|
|
|
742
762
|
This section is optional.
|
|
743
763
|
|
|
744
764
|
When present, it contains Odoo server configuration values written into `ROOT/odoo-configs/odoo-server.conf`.
|
|
765
|
+
|
|
745
766
|
When omitted, `odt-env` still generates a valid config file with generated values such as `addons_path` and `data_dir`.
|
|
746
767
|
|
|
747
768
|
You can define standard Odoo configuration options here.
|
|
@@ -767,7 +788,10 @@ http_port = 8069
|
|
|
767
788
|
|
|
768
789
|
## Script reference
|
|
769
790
|
|
|
770
|
-
|
|
791
|
+
Most helper scripts are generated in both Unix (`.sh`) and Windows (`.bat`) variants. `instance.sh` is available only on Unix-like systems.
|
|
792
|
+
|
|
793
|
+
Database backup and restore scripts are generated only when `[config].db_name` is configured.
|
|
794
|
+
|
|
771
795
|
The examples below use the Unix form.
|
|
772
796
|
|
|
773
797
|
### run
|