odoo-devops-tools 1.23.3__tar.gz → 1.23.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.23.3 → odoo_devops_tools-1.23.4}/PKG-INFO +49 -25
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/README.md +48 -24
- odoo_devops_tools-1.23.4/odoo_devops_tools/__init__.py +1 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools/env.py +98 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/PKG-INFO +49 -25
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/pyproject.toml +1 -1
- odoo_devops_tools-1.23.3/odoo_devops_tools/__init__.py +0 -1
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/LICENSE +0 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/SOURCES.txt +0 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/dependency_links.txt +0 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/entry_points.txt +0 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/top_level.txt +0 -0
- {odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.23.
|
|
3
|
+
Version: 1.23.4
|
|
4
4
|
Summary: Build reproducible Odoo workspaces from a single project definition.
|
|
5
5
|
Author: Roman Lacko
|
|
6
6
|
License-Expression: MIT
|
|
@@ -193,10 +193,10 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
193
193
|
--stop-after-init
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
For subsequent addon updates,
|
|
196
|
+
For subsequent addon updates, use the generated Docker update helper:
|
|
197
197
|
|
|
198
198
|
```bash
|
|
199
|
-
docker
|
|
199
|
+
./docker/local/scripts/update.sh
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
### 1.2. Running Odoo from workspace source
|
|
@@ -226,14 +226,16 @@ docker compose up -d --build
|
|
|
226
226
|
|
|
227
227
|
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.
|
|
228
228
|
|
|
229
|
-
### 1.3.
|
|
229
|
+
### 1.3. Script reference
|
|
230
230
|
|
|
231
|
-
The Docker workflow generates platform-specific
|
|
231
|
+
The Docker workflow generates platform-specific helper scripts under `ROOT/docker/local/scripts/`. Unix-like systems generate `.sh` helpers; Windows generates the corresponding `.bat` helpers.
|
|
232
232
|
|
|
233
233
|
On Unix-like systems:
|
|
234
234
|
|
|
235
235
|
```text
|
|
236
236
|
docker/local/scripts/
|
|
237
|
+
├── shell.sh
|
|
238
|
+
├── update.sh
|
|
237
239
|
├── backup-db.sh
|
|
238
240
|
├── restore-db.sh
|
|
239
241
|
├── neutralize-db.sh
|
|
@@ -244,15 +246,41 @@ docker/local/scripts/
|
|
|
244
246
|
└── restore-filestore-restic.sh
|
|
245
247
|
```
|
|
246
248
|
|
|
247
|
-
|
|
249
|
+
The examples below use the Unix `.sh` form.
|
|
248
250
|
|
|
249
|
-
|
|
251
|
+
#### 1.3.1. shell
|
|
252
|
+
|
|
253
|
+
Opens an Odoo shell for the configured database:
|
|
250
254
|
|
|
251
255
|
```bash
|
|
252
|
-
|
|
256
|
+
./docker/local/scripts/shell.sh
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it with `ODOO_DB_NAME`:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/shell.sh
|
|
253
263
|
```
|
|
254
264
|
|
|
255
|
-
|
|
265
|
+
Any extra arguments are passed through to the underlying Odoo shell command.
|
|
266
|
+
|
|
267
|
+
#### 1.3.2. update
|
|
268
|
+
|
|
269
|
+
Updates installed addons using `click-odoo-update`:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
./docker/local/scripts/update.sh
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
The default database name follows the same `ODOO_DB_NAME` convention as the shell and database helpers.
|
|
276
|
+
|
|
277
|
+
Any extra arguments are passed through to `click-odoo-update`:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
./docker/local/scripts/update.sh --update-all
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### 1.3.3. Database backup
|
|
256
284
|
|
|
257
285
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
258
286
|
|
|
@@ -272,7 +300,13 @@ Pass an output path explicitly when needed:
|
|
|
272
300
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
273
301
|
```
|
|
274
302
|
|
|
275
|
-
|
|
303
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it for any command with `ODOO_DB_NAME`:
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### 1.3.4. Database restore
|
|
276
310
|
|
|
277
311
|
Restore a database dump with `pg_restore`:
|
|
278
312
|
|
|
@@ -309,7 +343,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
309
343
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
310
344
|
```
|
|
311
345
|
|
|
312
|
-
#### 1.3.
|
|
346
|
+
#### 1.3.5. Database neutralization
|
|
313
347
|
|
|
314
348
|
For development or test databases restored from production, run the generated neutralization helper explicitly:
|
|
315
349
|
|
|
@@ -339,7 +373,7 @@ docker compose up -d odoo
|
|
|
339
373
|
|
|
340
374
|
`--copy` / `--move` and neutralization serve different purposes: copy/move controls restored database identity, while neutralization controls production side effects.
|
|
341
375
|
|
|
342
|
-
#### 1.3.
|
|
376
|
+
#### 1.3.6. Filestore backup
|
|
343
377
|
|
|
344
378
|
Create a compressed tar archive of the selected database filestore:
|
|
345
379
|
|
|
@@ -370,7 +404,7 @@ docker compose stop odoo
|
|
|
370
404
|
docker compose up -d odoo
|
|
371
405
|
```
|
|
372
406
|
|
|
373
|
-
#### 1.3.
|
|
407
|
+
#### 1.3.7. Filestore restore
|
|
374
408
|
|
|
375
409
|
Restore a filestore archive:
|
|
376
410
|
|
|
@@ -394,20 +428,10 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
394
428
|
|
|
395
429
|
Database and filestore backups are intentionally separate. This allows either part to be restored independently while still making it possible to create matching database and filestore backups when both are needed.
|
|
396
430
|
|
|
397
|
-
#### 1.3.
|
|
431
|
+
#### 1.3.8. Restic filestore backup
|
|
398
432
|
|
|
399
433
|
The generated Docker image also includes `restic`. Restic is an additional option intended especially for large filestores where incremental snapshots and deduplication are useful.
|
|
400
434
|
|
|
401
|
-
The Docker workflow generates platform-specific restic helpers: `.sh` on Unix-like systems and `.bat` on Windows.
|
|
402
|
-
|
|
403
|
-
```text
|
|
404
|
-
docker/local/scripts/restic.sh
|
|
405
|
-
docker/local/scripts/backup-filestore-restic.sh
|
|
406
|
-
docker/local/scripts/restore-filestore-restic.sh
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
The corresponding Windows helpers use the same names with the `.bat` extension. The `restic` helper runs the `restic` binary from the generated Odoo image against the same `odoo-data` volume. The restic cache is kept under `/var/lib/odoo/.cache/restic`, outside the filestore directory, so it persists between one-off containers without being included in filestore backups.
|
|
410
|
-
|
|
411
435
|
Set `RESTIC_REPOSITORY` and either `RESTIC_PASSWORD_FILE` or `RESTIC_PASSWORD` before using the helpers. For a local repository on the Docker host, use an absolute path. The wrapper automatically bind-mounts the repository into the one-off container; Windows drive paths such as `C:\backups\odoo` are supported by `restic.bat`:
|
|
412
436
|
|
|
413
437
|
```bash
|
|
@@ -442,7 +466,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
442
466
|
./docker/local/scripts/restic.sh check
|
|
443
467
|
```
|
|
444
468
|
|
|
445
|
-
#### 1.3.
|
|
469
|
+
#### 1.3.9. Restic filestore restore
|
|
446
470
|
|
|
447
471
|
Restore the latest matching filestore snapshot:
|
|
448
472
|
|
|
@@ -165,10 +165,10 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
165
165
|
--stop-after-init
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
For subsequent addon updates,
|
|
168
|
+
For subsequent addon updates, use the generated Docker update helper:
|
|
169
169
|
|
|
170
170
|
```bash
|
|
171
|
-
docker
|
|
171
|
+
./docker/local/scripts/update.sh
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
### 1.2. Running Odoo from workspace source
|
|
@@ -198,14 +198,16 @@ docker compose up -d --build
|
|
|
198
198
|
|
|
199
199
|
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.
|
|
200
200
|
|
|
201
|
-
### 1.3.
|
|
201
|
+
### 1.3. Script reference
|
|
202
202
|
|
|
203
|
-
The Docker workflow generates platform-specific
|
|
203
|
+
The Docker workflow generates platform-specific helper scripts under `ROOT/docker/local/scripts/`. Unix-like systems generate `.sh` helpers; Windows generates the corresponding `.bat` helpers.
|
|
204
204
|
|
|
205
205
|
On Unix-like systems:
|
|
206
206
|
|
|
207
207
|
```text
|
|
208
208
|
docker/local/scripts/
|
|
209
|
+
├── shell.sh
|
|
210
|
+
├── update.sh
|
|
209
211
|
├── backup-db.sh
|
|
210
212
|
├── restore-db.sh
|
|
211
213
|
├── neutralize-db.sh
|
|
@@ -216,15 +218,41 @@ docker/local/scripts/
|
|
|
216
218
|
└── restore-filestore-restic.sh
|
|
217
219
|
```
|
|
218
220
|
|
|
219
|
-
|
|
221
|
+
The examples below use the Unix `.sh` form.
|
|
220
222
|
|
|
221
|
-
|
|
223
|
+
#### 1.3.1. shell
|
|
224
|
+
|
|
225
|
+
Opens an Odoo shell for the configured database:
|
|
222
226
|
|
|
223
227
|
```bash
|
|
224
|
-
|
|
228
|
+
./docker/local/scripts/shell.sh
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it with `ODOO_DB_NAME`:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/shell.sh
|
|
225
235
|
```
|
|
226
236
|
|
|
227
|
-
|
|
237
|
+
Any extra arguments are passed through to the underlying Odoo shell command.
|
|
238
|
+
|
|
239
|
+
#### 1.3.2. update
|
|
240
|
+
|
|
241
|
+
Updates installed addons using `click-odoo-update`:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
./docker/local/scripts/update.sh
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
The default database name follows the same `ODOO_DB_NAME` convention as the shell and database helpers.
|
|
248
|
+
|
|
249
|
+
Any extra arguments are passed through to `click-odoo-update`:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
./docker/local/scripts/update.sh --update-all
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### 1.3.3. Database backup
|
|
228
256
|
|
|
229
257
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
230
258
|
|
|
@@ -244,7 +272,13 @@ Pass an output path explicitly when needed:
|
|
|
244
272
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
245
273
|
```
|
|
246
274
|
|
|
247
|
-
|
|
275
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it for any command with `ODOO_DB_NAME`:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### 1.3.4. Database restore
|
|
248
282
|
|
|
249
283
|
Restore a database dump with `pg_restore`:
|
|
250
284
|
|
|
@@ -281,7 +315,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
281
315
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
282
316
|
```
|
|
283
317
|
|
|
284
|
-
#### 1.3.
|
|
318
|
+
#### 1.3.5. Database neutralization
|
|
285
319
|
|
|
286
320
|
For development or test databases restored from production, run the generated neutralization helper explicitly:
|
|
287
321
|
|
|
@@ -311,7 +345,7 @@ docker compose up -d odoo
|
|
|
311
345
|
|
|
312
346
|
`--copy` / `--move` and neutralization serve different purposes: copy/move controls restored database identity, while neutralization controls production side effects.
|
|
313
347
|
|
|
314
|
-
#### 1.3.
|
|
348
|
+
#### 1.3.6. Filestore backup
|
|
315
349
|
|
|
316
350
|
Create a compressed tar archive of the selected database filestore:
|
|
317
351
|
|
|
@@ -342,7 +376,7 @@ docker compose stop odoo
|
|
|
342
376
|
docker compose up -d odoo
|
|
343
377
|
```
|
|
344
378
|
|
|
345
|
-
#### 1.3.
|
|
379
|
+
#### 1.3.7. Filestore restore
|
|
346
380
|
|
|
347
381
|
Restore a filestore archive:
|
|
348
382
|
|
|
@@ -366,20 +400,10 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
366
400
|
|
|
367
401
|
Database and filestore backups are intentionally separate. This allows either part to be restored independently while still making it possible to create matching database and filestore backups when both are needed.
|
|
368
402
|
|
|
369
|
-
#### 1.3.
|
|
403
|
+
#### 1.3.8. Restic filestore backup
|
|
370
404
|
|
|
371
405
|
The generated Docker image also includes `restic`. Restic is an additional option intended especially for large filestores where incremental snapshots and deduplication are useful.
|
|
372
406
|
|
|
373
|
-
The Docker workflow generates platform-specific restic helpers: `.sh` on Unix-like systems and `.bat` on Windows.
|
|
374
|
-
|
|
375
|
-
```text
|
|
376
|
-
docker/local/scripts/restic.sh
|
|
377
|
-
docker/local/scripts/backup-filestore-restic.sh
|
|
378
|
-
docker/local/scripts/restore-filestore-restic.sh
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
The corresponding Windows helpers use the same names with the `.bat` extension. The `restic` helper runs the `restic` binary from the generated Odoo image against the same `odoo-data` volume. The restic cache is kept under `/var/lib/odoo/.cache/restic`, outside the filestore directory, so it persists between one-off containers without being included in filestore backups.
|
|
382
|
-
|
|
383
407
|
Set `RESTIC_REPOSITORY` and either `RESTIC_PASSWORD_FILE` or `RESTIC_PASSWORD` before using the helpers. For a local repository on the Docker host, use an absolute path. The wrapper automatically bind-mounts the repository into the one-off container; Windows drive paths such as `C:\backups\odoo` are supported by `restic.bat`:
|
|
384
408
|
|
|
385
409
|
```bash
|
|
@@ -414,7 +438,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
414
438
|
./docker/local/scripts/restic.sh check
|
|
415
439
|
```
|
|
416
440
|
|
|
417
|
-
#### 1.3.
|
|
441
|
+
#### 1.3.9. Restic filestore restore
|
|
418
442
|
|
|
419
443
|
Restore the latest matching filestore snapshot:
|
|
420
444
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.23.4"
|
|
@@ -3125,6 +3125,52 @@ echo "INFO: Database restore completed: ${{DB_NAME}}"
|
|
|
3125
3125
|
return _write_docker_local_script(layout, "restore-db", content)
|
|
3126
3126
|
|
|
3127
3127
|
|
|
3128
|
+
def write_docker_shell_sh(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3129
|
+
default_db_name = shlex.quote(_docker_default_db_name(cfg))
|
|
3130
|
+
content = fr"""#!/usr/bin/env bash
|
|
3131
|
+
set -euo pipefail
|
|
3132
|
+
|
|
3133
|
+
SCRIPT_DIR="$(cd "$(dirname "${{BASH_SOURCE[0]}}")" && pwd)"
|
|
3134
|
+
ROOT_DIR="$(cd "${{SCRIPT_DIR}}/../../.." && pwd)"
|
|
3135
|
+
DEFAULT_DB_NAME={default_db_name}
|
|
3136
|
+
DB_NAME="${{ODOO_DB_NAME:-${{DEFAULT_DB_NAME}}}}"
|
|
3137
|
+
|
|
3138
|
+
cd "${{ROOT_DIR}}"
|
|
3139
|
+
|
|
3140
|
+
echo "INFO: Opening Odoo shell for database '${{DB_NAME}}'."
|
|
3141
|
+
exec docker compose run --rm --no-deps \
|
|
3142
|
+
--entrypoint odoo odoo \
|
|
3143
|
+
shell \
|
|
3144
|
+
-c /etc/odoo/odoo.conf \
|
|
3145
|
+
-d "${{DB_NAME}}" \
|
|
3146
|
+
"$@"
|
|
3147
|
+
"""
|
|
3148
|
+
return _write_docker_local_script(layout, "shell", content)
|
|
3149
|
+
|
|
3150
|
+
|
|
3151
|
+
def write_docker_update_sh(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3152
|
+
default_db_name = shlex.quote(_docker_default_db_name(cfg))
|
|
3153
|
+
content = fr"""#!/usr/bin/env bash
|
|
3154
|
+
set -euo pipefail
|
|
3155
|
+
|
|
3156
|
+
SCRIPT_DIR="$(cd "$(dirname "${{BASH_SOURCE[0]}}")" && pwd)"
|
|
3157
|
+
ROOT_DIR="$(cd "${{SCRIPT_DIR}}/../../.." && pwd)"
|
|
3158
|
+
DEFAULT_DB_NAME={default_db_name}
|
|
3159
|
+
DB_NAME="${{ODOO_DB_NAME:-${{DEFAULT_DB_NAME}}}}"
|
|
3160
|
+
|
|
3161
|
+
cd "${{ROOT_DIR}}"
|
|
3162
|
+
|
|
3163
|
+
echo "INFO: Updating Odoo addons for database '${{DB_NAME}}'. Passing through any extra arguments."
|
|
3164
|
+
exec docker compose run --rm --no-deps -T \
|
|
3165
|
+
--entrypoint click-odoo-update odoo \
|
|
3166
|
+
-c /etc/odoo/odoo.conf \
|
|
3167
|
+
-d "${{DB_NAME}}" \
|
|
3168
|
+
--log-level debug \
|
|
3169
|
+
"$@"
|
|
3170
|
+
"""
|
|
3171
|
+
return _write_docker_local_script(layout, "update", content)
|
|
3172
|
+
|
|
3173
|
+
|
|
3128
3174
|
def write_docker_neutralize_db_sh(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3129
3175
|
default_db_name = shlex.quote(_docker_default_db_name(cfg))
|
|
3130
3176
|
odoo_major_version = _parse_odoo_version(cfg.odoo.version)
|
|
@@ -3617,6 +3663,54 @@ exit /b 2
|
|
|
3617
3663
|
return _write_docker_local_script(layout, "restore-db", content, ext="bat")
|
|
3618
3664
|
|
|
3619
3665
|
|
|
3666
|
+
def write_docker_shell_bat(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3667
|
+
default_db_name = _docker_default_db_name(cfg).replace("%", "%%")
|
|
3668
|
+
content = rf"""@echo off
|
|
3669
|
+
setlocal
|
|
3670
|
+
|
|
3671
|
+
set "SCRIPT_DIR=%~dp0"
|
|
3672
|
+
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
|
3673
|
+
for %%I in ("%SCRIPT_DIR%\..\..\..") do set "ROOT_DIR=%%~fI"
|
|
3674
|
+
set "DEFAULT_DB_NAME={default_db_name}"
|
|
3675
|
+
if defined ODOO_DB_NAME (
|
|
3676
|
+
set "DB_NAME=%ODOO_DB_NAME%"
|
|
3677
|
+
) else (
|
|
3678
|
+
set "DB_NAME=%DEFAULT_DB_NAME%"
|
|
3679
|
+
)
|
|
3680
|
+
|
|
3681
|
+
cd /d "%ROOT_DIR%" || exit /b 1
|
|
3682
|
+
|
|
3683
|
+
echo INFO: Opening Odoo shell for database '%DB_NAME%'.
|
|
3684
|
+
docker compose run --rm --no-deps --entrypoint odoo odoo shell -c /etc/odoo/odoo.conf -d "%DB_NAME%" %*
|
|
3685
|
+
exit /b %ERRORLEVEL%
|
|
3686
|
+
"""
|
|
3687
|
+
return _write_docker_local_script(layout, "shell", content, ext="bat")
|
|
3688
|
+
|
|
3689
|
+
|
|
3690
|
+
def write_docker_update_bat(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3691
|
+
default_db_name = _docker_default_db_name(cfg).replace("%", "%%")
|
|
3692
|
+
content = rf"""@echo off
|
|
3693
|
+
setlocal
|
|
3694
|
+
|
|
3695
|
+
set "SCRIPT_DIR=%~dp0"
|
|
3696
|
+
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
|
3697
|
+
for %%I in ("%SCRIPT_DIR%\..\..\..") do set "ROOT_DIR=%%~fI"
|
|
3698
|
+
set "DEFAULT_DB_NAME={default_db_name}"
|
|
3699
|
+
if defined ODOO_DB_NAME (
|
|
3700
|
+
set "DB_NAME=%ODOO_DB_NAME%"
|
|
3701
|
+
) else (
|
|
3702
|
+
set "DB_NAME=%DEFAULT_DB_NAME%"
|
|
3703
|
+
)
|
|
3704
|
+
|
|
3705
|
+
cd /d "%ROOT_DIR%" || exit /b 1
|
|
3706
|
+
|
|
3707
|
+
echo INFO: Updating Odoo addons for database '%DB_NAME%'. Passing through any extra arguments.
|
|
3708
|
+
docker compose run --rm --no-deps -T --entrypoint click-odoo-update odoo -c /etc/odoo/odoo.conf -d "%DB_NAME%" --log-level debug %*
|
|
3709
|
+
exit /b %ERRORLEVEL%
|
|
3710
|
+
"""
|
|
3711
|
+
return _write_docker_local_script(layout, "update", content, ext="bat")
|
|
3712
|
+
|
|
3713
|
+
|
|
3620
3714
|
def write_docker_neutralize_db_bat(layout: Layout, cfg: ProjectConfig) -> Path:
|
|
3621
3715
|
default_db_name = _docker_default_db_name(cfg).replace("%", "%%")
|
|
3622
3716
|
odoo_major_version = _parse_odoo_version(cfg.odoo.version)
|
|
@@ -4027,6 +4121,8 @@ exit /b 2
|
|
|
4027
4121
|
def write_docker_local_scripts(layout: Layout, cfg: ProjectConfig) -> dict[str, Path]:
|
|
4028
4122
|
if sys.platform.startswith("win"):
|
|
4029
4123
|
return {
|
|
4124
|
+
"shell": write_docker_shell_bat(layout, cfg),
|
|
4125
|
+
"update": write_docker_update_bat(layout, cfg),
|
|
4030
4126
|
"backup_db": write_docker_backup_db_bat(layout, cfg),
|
|
4031
4127
|
"restore_db": write_docker_restore_db_bat(layout, cfg),
|
|
4032
4128
|
"neutralize_db": write_docker_neutralize_db_bat(layout, cfg),
|
|
@@ -4038,6 +4134,8 @@ def write_docker_local_scripts(layout: Layout, cfg: ProjectConfig) -> dict[str,
|
|
|
4038
4134
|
}
|
|
4039
4135
|
|
|
4040
4136
|
return {
|
|
4137
|
+
"shell": write_docker_shell_sh(layout, cfg),
|
|
4138
|
+
"update": write_docker_update_sh(layout, cfg),
|
|
4041
4139
|
"backup_db": write_docker_backup_db_sh(layout, cfg),
|
|
4042
4140
|
"restore_db": write_docker_restore_db_sh(layout, cfg),
|
|
4043
4141
|
"neutralize_db": write_docker_neutralize_db_sh(layout, cfg),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.23.
|
|
3
|
+
Version: 1.23.4
|
|
4
4
|
Summary: Build reproducible Odoo workspaces from a single project definition.
|
|
5
5
|
Author: Roman Lacko
|
|
6
6
|
License-Expression: MIT
|
|
@@ -193,10 +193,10 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
193
193
|
--stop-after-init
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
For subsequent addon updates,
|
|
196
|
+
For subsequent addon updates, use the generated Docker update helper:
|
|
197
197
|
|
|
198
198
|
```bash
|
|
199
|
-
docker
|
|
199
|
+
./docker/local/scripts/update.sh
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
### 1.2. Running Odoo from workspace source
|
|
@@ -226,14 +226,16 @@ docker compose up -d --build
|
|
|
226
226
|
|
|
227
227
|
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.
|
|
228
228
|
|
|
229
|
-
### 1.3.
|
|
229
|
+
### 1.3. Script reference
|
|
230
230
|
|
|
231
|
-
The Docker workflow generates platform-specific
|
|
231
|
+
The Docker workflow generates platform-specific helper scripts under `ROOT/docker/local/scripts/`. Unix-like systems generate `.sh` helpers; Windows generates the corresponding `.bat` helpers.
|
|
232
232
|
|
|
233
233
|
On Unix-like systems:
|
|
234
234
|
|
|
235
235
|
```text
|
|
236
236
|
docker/local/scripts/
|
|
237
|
+
├── shell.sh
|
|
238
|
+
├── update.sh
|
|
237
239
|
├── backup-db.sh
|
|
238
240
|
├── restore-db.sh
|
|
239
241
|
├── neutralize-db.sh
|
|
@@ -244,15 +246,41 @@ docker/local/scripts/
|
|
|
244
246
|
└── restore-filestore-restic.sh
|
|
245
247
|
```
|
|
246
248
|
|
|
247
|
-
|
|
249
|
+
The examples below use the Unix `.sh` form.
|
|
248
250
|
|
|
249
|
-
|
|
251
|
+
#### 1.3.1. shell
|
|
252
|
+
|
|
253
|
+
Opens an Odoo shell for the configured database:
|
|
250
254
|
|
|
251
255
|
```bash
|
|
252
|
-
|
|
256
|
+
./docker/local/scripts/shell.sh
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it with `ODOO_DB_NAME`:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/shell.sh
|
|
253
263
|
```
|
|
254
264
|
|
|
255
|
-
|
|
265
|
+
Any extra arguments are passed through to the underlying Odoo shell command.
|
|
266
|
+
|
|
267
|
+
#### 1.3.2. update
|
|
268
|
+
|
|
269
|
+
Updates installed addons using `click-odoo-update`:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
./docker/local/scripts/update.sh
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
The default database name follows the same `ODOO_DB_NAME` convention as the shell and database helpers.
|
|
276
|
+
|
|
277
|
+
Any extra arguments are passed through to `click-odoo-update`:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
./docker/local/scripts/update.sh --update-all
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### 1.3.3. Database backup
|
|
256
284
|
|
|
257
285
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
258
286
|
|
|
@@ -272,7 +300,13 @@ Pass an output path explicitly when needed:
|
|
|
272
300
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
273
301
|
```
|
|
274
302
|
|
|
275
|
-
|
|
303
|
+
The default database name is taken from `[config].db_name` when configured, otherwise it is `odoo`. Override it for any command with `ODOO_DB_NAME`:
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### 1.3.4. Database restore
|
|
276
310
|
|
|
277
311
|
Restore a database dump with `pg_restore`:
|
|
278
312
|
|
|
@@ -309,7 +343,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
309
343
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
310
344
|
```
|
|
311
345
|
|
|
312
|
-
#### 1.3.
|
|
346
|
+
#### 1.3.5. Database neutralization
|
|
313
347
|
|
|
314
348
|
For development or test databases restored from production, run the generated neutralization helper explicitly:
|
|
315
349
|
|
|
@@ -339,7 +373,7 @@ docker compose up -d odoo
|
|
|
339
373
|
|
|
340
374
|
`--copy` / `--move` and neutralization serve different purposes: copy/move controls restored database identity, while neutralization controls production side effects.
|
|
341
375
|
|
|
342
|
-
#### 1.3.
|
|
376
|
+
#### 1.3.6. Filestore backup
|
|
343
377
|
|
|
344
378
|
Create a compressed tar archive of the selected database filestore:
|
|
345
379
|
|
|
@@ -370,7 +404,7 @@ docker compose stop odoo
|
|
|
370
404
|
docker compose up -d odoo
|
|
371
405
|
```
|
|
372
406
|
|
|
373
|
-
#### 1.3.
|
|
407
|
+
#### 1.3.7. Filestore restore
|
|
374
408
|
|
|
375
409
|
Restore a filestore archive:
|
|
376
410
|
|
|
@@ -394,20 +428,10 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
394
428
|
|
|
395
429
|
Database and filestore backups are intentionally separate. This allows either part to be restored independently while still making it possible to create matching database and filestore backups when both are needed.
|
|
396
430
|
|
|
397
|
-
#### 1.3.
|
|
431
|
+
#### 1.3.8. Restic filestore backup
|
|
398
432
|
|
|
399
433
|
The generated Docker image also includes `restic`. Restic is an additional option intended especially for large filestores where incremental snapshots and deduplication are useful.
|
|
400
434
|
|
|
401
|
-
The Docker workflow generates platform-specific restic helpers: `.sh` on Unix-like systems and `.bat` on Windows.
|
|
402
|
-
|
|
403
|
-
```text
|
|
404
|
-
docker/local/scripts/restic.sh
|
|
405
|
-
docker/local/scripts/backup-filestore-restic.sh
|
|
406
|
-
docker/local/scripts/restore-filestore-restic.sh
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
The corresponding Windows helpers use the same names with the `.bat` extension. The `restic` helper runs the `restic` binary from the generated Odoo image against the same `odoo-data` volume. The restic cache is kept under `/var/lib/odoo/.cache/restic`, outside the filestore directory, so it persists between one-off containers without being included in filestore backups.
|
|
410
|
-
|
|
411
435
|
Set `RESTIC_REPOSITORY` and either `RESTIC_PASSWORD_FILE` or `RESTIC_PASSWORD` before using the helpers. For a local repository on the Docker host, use an absolute path. The wrapper automatically bind-mounts the repository into the one-off container; Windows drive paths such as `C:\backups\odoo` are supported by `restic.bat`:
|
|
412
436
|
|
|
413
437
|
```bash
|
|
@@ -442,7 +466,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
442
466
|
./docker/local/scripts/restic.sh check
|
|
443
467
|
```
|
|
444
468
|
|
|
445
|
-
#### 1.3.
|
|
469
|
+
#### 1.3.9. Restic filestore restore
|
|
446
470
|
|
|
447
471
|
Restore the latest matching filestore snapshot:
|
|
448
472
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.23.3"
|
|
File without changes
|
{odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{odoo_devops_tools-1.23.3 → odoo_devops_tools-1.23.4}/odoo_devops_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|