rocketdoo 2.3.0__tar.gz → 2.3.1__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.
Files changed (56) hide show
  1. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/LICENSE +1 -1
  2. {rocketdoo-2.3.0/rocketdoo.egg-info → rocketdoo-2.3.1}/PKG-INFO +3 -3
  3. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/README.md +1 -1
  4. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/pyproject.toml +1 -1
  5. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/pack_environment.py +43 -13
  6. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/unpack_environment.py +89 -7
  7. {rocketdoo-2.3.0 → rocketdoo-2.3.1/rocketdoo.egg-info}/PKG-INFO +3 -3
  8. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/MANIFEST.in +0 -0
  9. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/__init__.py +0 -0
  10. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/cli.py +0 -0
  11. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/config.py +0 -0
  12. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/__init__.py +0 -0
  13. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/config_loader.py +0 -0
  14. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/__init__.py +0 -0
  15. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/base.py +0 -0
  16. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/config_manager.py +0 -0
  17. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/module_packager.py +0 -0
  18. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/odoo_sh.py +0 -0
  19. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/deploy/vps.py +0 -0
  20. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/edition_setup.py +0 -0
  21. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/generator.py +0 -0
  22. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/gitman_config.py +0 -0
  23. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/module_scanner.py +0 -0
  24. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/port_validation.py +0 -0
  25. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/ssh_manager.py +0 -0
  26. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/core/utils.py +0 -0
  27. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/delete_identifiers.py +0 -0
  28. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/deploy_cli.py +0 -0
  29. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/docker_cli.py +0 -0
  30. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/init_project.py +0 -0
  31. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/main.py +0 -0
  32. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/project_info.py +0 -0
  33. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/rocketdoo.py +0 -0
  34. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/scaffold.py +0 -0
  35. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/.devcontainer/devcontainer.json +0 -0
  36. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/.devcontainer/docker-compose.yaml +0 -0
  37. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/.vscode/launch.json +0 -0
  38. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/.vscode/launch.json.jinja +0 -0
  39. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/.vscode/settings.json +0 -0
  40. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/Dockerfile.jinja +0 -0
  41. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/addons/.gitkeep +0 -0
  42. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/config/odoo.conf +0 -0
  43. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/config/odoo.conf.jinja +0 -0
  44. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/deploy/.deployignore +0 -0
  45. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/deploy/deploy.yaml +0 -0
  46. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/deploy/deploy.yaml.jinja +0 -0
  47. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/docker-compose.yaml.jinja +0 -0
  48. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/install_dependencies.sh +0 -0
  49. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/templates/odoo_pg_pass +0 -0
  50. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo/welcome.py +0 -0
  51. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo.egg-info/SOURCES.txt +0 -0
  52. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo.egg-info/dependency_links.txt +0 -0
  53. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo.egg-info/entry_points.txt +0 -0
  54. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo.egg-info/requires.txt +0 -0
  55. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/rocketdoo.egg-info/top_level.txt +0 -0
  56. {rocketdoo-2.3.0 → rocketdoo-2.3.1}/setup.cfg +0 -0
@@ -57,7 +57,7 @@ If the Library as you received it specifies that a proxy can decide whether futu
57
57
  <div RKD as ROCKETDOO V2=""></div>
58
58
 
59
59
  Licencia: LGPL-3.0+
60
- Versión: "2.3.0"
60
+ Versión: "2.3.1"
61
61
  Autor: Horacio Montaño, Elias Braceras
62
62
  Fecha: 16/10/2024
63
63
  Descripción: Framework to development Odoo
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rocketdoo
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: Framework for creating Odoo development environments with Docker and custom templates.
5
5
  Author-email: Horacio Montaño <horaciomontano@hdmsoft.com.ar>
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -62,7 +62,7 @@ License: GNU LESSER GENERAL PUBLIC LICENSE
62
62
  <div RKD as ROCKETDOO V2=""></div>
63
63
 
64
64
  Licencia: LGPL-3.0+
65
- Versión: "2.3.0"
65
+ Versión: "2.3.1"
66
66
  Autor: Horacio Montaño, Elias Braceras
67
67
  Fecha: 16/10/2024
68
68
  Descripción: Framework to development Odoo
@@ -95,7 +95,7 @@ Odoo Development Framework
95
95
  - "Horacio Montaño" and "Elias Braceras"
96
96
 
97
97
  ## Version:
98
- - "2.3.0"
98
+ - "2.3.1"
99
99
 
100
100
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
101
101
 
@@ -15,7 +15,7 @@ Odoo Development Framework
15
15
  - "Horacio Montaño" and "Elias Braceras"
16
16
 
17
17
  ## Version:
18
- - "2.3.0"
18
+ - "2.3.1"
19
19
 
20
20
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
21
21
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rocketdoo"
3
- version = "2.3.0"
3
+ version = "2.3.1"
4
4
  description = "Framework for creating Odoo development environments with Docker and custom templates."
5
5
  authors = [
6
6
  { name = "Horacio Montaño", email = "horaciomontano@hdmsoft.com.ar" }
@@ -108,37 +108,67 @@ def _backup_database(db_container: str, db_name: str, output_path: Path) -> bool
108
108
  def _backup_filestore(odoo_container: str, db_name: str, output_path: Path) -> bool:
109
109
  """
110
110
  Copies and compresses the Odoo filestore from the container to the host.
111
- Filestore path inside container: /var/lib/odoo/.local/share/Odoo/filestore/<db_name>/
111
+
112
+ Supports multiple filestore layouts:
113
+ - /var/lib/odoo/.local/share/Odoo/filestore/<db_name>
114
+ - /var/lib/odoo/filestore/<db_name>
112
115
  """
113
- filestore_path = f"/var/lib/odoo/.local/share/Odoo/filestore/{db_name}"
114
116
  console.print(f" [dim]Copying filestore from container...[/dim]")
117
+
118
+ POSSIBLE_PATHS = [
119
+ f"/var/lib/odoo/.local/share/Odoo/filestore/{db_name}",
120
+ f"/var/lib/odoo/filestore/{db_name}",
121
+ ]
122
+
123
+ filestore_path = None
124
+ filestore_base = None
125
+
115
126
  try:
116
- check = subprocess.run(
117
- ["docker", "exec", odoo_container, "test", "-d", filestore_path],
118
- capture_output=True
119
- )
120
- if check.returncode != 0:
121
- console.print(f" [yellow]⚠[/yellow] Filestore not found at [dim]{filestore_path}[/dim] — skipping.")
122
- return True # Not a fatal error
127
+ # ── Detect filestore path dynamically ──
128
+ for path in POSSIBLE_PATHS:
129
+ check = subprocess.run(
130
+ ["docker", "exec", odoo_container, "test", "-d", path],
131
+ capture_output=True
132
+ )
133
+ if check.returncode == 0:
134
+ filestore_path = path
135
+ filestore_base = str(Path(path).parent)
136
+ break
137
+
138
+ if not filestore_path:
139
+ console.print(
140
+ f" [yellow]⚠[/yellow] Filestore not found for database "
141
+ f"[cyan]{db_name}[/cyan] in any known location — skipping."
142
+ )
143
+ return True # Not fatal
144
+
145
+ console.print(f" [dim]Detected filestore path:[/dim] [cyan]{filestore_path}[/cyan]")
123
146
 
147
+ # ── Compress filestore ──
124
148
  with open(output_path, "wb") as f:
125
149
  result = subprocess.run(
126
150
  [
127
151
  "docker", "exec", odoo_container,
128
152
  "tar", "-czf", "-", "-C",
129
- "/var/lib/odoo/.local/share/Odoo/filestore/",
153
+ filestore_base,
130
154
  db_name
131
155
  ],
132
156
  stdout=f,
133
157
  stderr=subprocess.PIPE
134
158
  )
159
+
135
160
  if result.returncode != 0:
136
161
  console.print(f" [red]✗ Error copying filestore:[/red] {result.stderr.decode()}")
137
162
  return False
138
163
 
139
164
  size_mb = output_path.stat().st_size / (1024 * 1024)
140
- console.print(f" [green]✓[/green] Filestore compressed: [yellow]{output_path.name}[/yellow] ({size_mb:.1f} MB)")
165
+ console.print(
166
+ f" [green]✓[/green] Filestore compressed: "
167
+ f"[yellow]{output_path.name}[/yellow] ({size_mb:.1f} MB)"
168
+ )
169
+
141
170
  return True
171
+
142
172
  except Exception as e:
143
173
  console.print(f" [red]✗ Exception during filestore backup:[/red] {e}")
144
174
  return False
@@ -199,11 +229,11 @@ def _verify_no_ssh_in_zip(zip_path: Path) -> list[str]:
199
229
  def _create_zip(project_dir: Path, zip_path: Path, backup_dir: Path, exclude_dirs: list[str]) -> int:
200
230
  """
201
231
  Creates the ZIP archive of the full environment.
202
- Excludes: .ssh/, __pycache__, .git/, node_modules, and any extra dirs provided.
232
+ Excludes: .ssh/, __pycache__, node_modules, and any extra dirs provided.
203
233
  Includes the backup directory contents under rkd_backups/.
204
234
  Returns the number of files included.
205
235
  """
206
- ALWAYS_EXCLUDE = {".ssh", "__pycache__", ".git", "node_modules", ".mypy_cache"}
236
+ ALWAYS_EXCLUDE = {".ssh", "__pycache__", "node_modules", ".mypy_cache"}
207
237
  excluded = ALWAYS_EXCLUDE | set(exclude_dirs)
208
238
 
209
239
  file_count = 0
@@ -206,6 +206,30 @@ def _wait_for_postgres(db_container: str, max_wait: int = 60) -> bool:
206
206
  return False
207
207
 
208
208
 
209
+ def _wait_for_odoo_volume(odoo_container: str, max_wait: int = 90) -> bool:
210
+ """
211
+ Waits until /var/lib/odoo is mounted and accessible inside the Odoo container.
212
+
213
+ Replaces time.sleep(5): the Docker volume may take several seconds to become
214
+ available after the container starts, especially on first run. Without this
215
+ check the filestore restore would silently fail writing to a non-existent path.
216
+ """
217
+ console.print(f" [dim]Waiting for Odoo volume to be ready (max {max_wait}s)...[/dim]")
218
+ for i in range(max_wait):
219
+ result = subprocess.run(
220
+ ["docker", "exec", odoo_container, "test", "-d", "/var/lib/odoo"],
221
+ capture_output=True
222
+ )
223
+ if result.returncode == 0:
224
+ console.print(f" [green]✓[/green] Odoo volume is ready.")
225
+ return True
226
+ time.sleep(1)
227
+ if i % 15 == 14:
228
+ console.print(f" [dim] ...{i + 1}s[/dim]")
229
+ console.print(f" [yellow]⚠[/yellow] Odoo volume not ready after {max_wait}s.")
230
+ return False
231
+
232
+
209
233
  def _restore_database(db_container: str, dump_path: Path) -> str | None:
210
234
  """
211
235
  Restores the PostgreSQL dump into the container.
@@ -264,9 +288,16 @@ def _restore_database(db_container: str, dump_path: Path) -> str | None:
264
288
 
265
289
 
266
290
  def _restore_filestore(odoo_container: str, filestore_tar: Path, db_name: str) -> bool:
267
- """Restores the Odoo filestore into the web container."""
291
+ """Restores the Odoo filestore into the web container (supports multiple layouts)."""
268
292
  console.print(f" [dim]Restoring filestore for [cyan]{db_name}[/cyan]...[/dim]")
293
+
294
+ POSSIBLE_BASES = [
295
+ "/var/lib/odoo/.local/share/Odoo/filestore",
296
+ "/var/lib/odoo/filestore",
297
+ ]
298
+
269
299
  try:
300
+ # ── 1. Copy tar to container ──
270
301
  copy_result = subprocess.run(
271
302
  ["docker", "cp", str(filestore_tar), f"{odoo_container}:/tmp/rkd_filestore.tar.gz"],
272
303
  capture_output=True, text=True
@@ -275,23 +306,67 @@ def _restore_filestore(odoo_container: str, filestore_tar: Path, db_name: str) -
275
306
  console.print(f" [yellow]⚠[/yellow] Could not copy filestore: {copy_result.stderr}")
276
307
  return False
277
308
 
278
- filestore_base = "/var/lib/odoo/.local/share/Odoo/filestore"
309
+ # ── 2. Detect filestore base ──
310
+ filestore_base = None
311
+
312
+ for base in POSSIBLE_BASES:
313
+ check = subprocess.run(
314
+ ["docker", "exec", odoo_container, "test", "-d", base],
315
+ capture_output=True
316
+ )
317
+ if check.returncode == 0:
318
+ filestore_base = base
319
+ break
320
+
321
+ # fallback → usar layout simple
322
+ if not filestore_base:
323
+ filestore_base = "/var/lib/odoo/filestore"
324
+ console.print(
325
+ f" [yellow]⚠[/yellow] Filestore base not found. Using fallback: "
326
+ f"[cyan]{filestore_base}[/cyan]"
327
+ )
328
+
329
+ console.print(f" [dim]Using filestore base:[/dim] [cyan]{filestore_base}[/cyan]")
330
+
331
+ # ── 3. Ensure base exists ──
279
332
  subprocess.run(
280
333
  ["docker", "exec", odoo_container, "mkdir", "-p", filestore_base],
281
334
  capture_output=True
282
335
  )
283
336
 
337
+ # ── 4. Clean existing filestore (VERY IMPORTANT) ──
338
+ console.print(f" [dim]Cleaning existing filestore for {db_name}...[/dim]")
339
+ subprocess.run(
340
+ ["docker", "exec", odoo_container, "rm", "-rf", f"{filestore_base}/{db_name}"],
341
+ capture_output=True
342
+ )
343
+
344
+ # ── 5. Extract tar ──
284
345
  extract_result = subprocess.run(
285
- ["docker", "exec", odoo_container,
286
- "tar", "-xzf", "/tmp/rkd_filestore.tar.gz", "-C", filestore_base],
346
+ [
347
+ "docker", "exec", odoo_container,
348
+ "tar", "-xzf", "/tmp/rkd_filestore.tar.gz",
349
+ "-C", filestore_base
350
+ ],
287
351
  capture_output=True, text=True
288
352
  )
353
+
289
354
  if extract_result.returncode != 0:
290
355
  console.print(f" [yellow]⚠[/yellow] Error extracting filestore: {extract_result.stderr}")
291
356
  return False
292
357
 
293
- console.print(f" [green]✓[/green] Filestore restored inside the container.")
358
+ # ── 6. Fix permissions ──
359
+ subprocess.run(
360
+ [
361
+ "docker", "exec", odoo_container,
362
+ "chown", "-R", "odoo:odoo", f"{filestore_base}/{db_name}"
363
+ ],
364
+ capture_output=True
365
+ )
366
+
367
+ console.print(f" [green]✓[/green] Filestore restored successfully.")
294
368
  return True
369
+
295
370
  except Exception as e:
296
371
  console.print(f" [yellow]⚠[/yellow] Exception while restoring filestore: {e}")
297
372
  return False
@@ -451,11 +526,18 @@ def unpack_environment(no_restore, build):
451
526
  console.print("[bold]🗂️ Restoring filestore:[/bold]")
452
527
  console.print("[dim] Starting web service to restore filestore...[/dim]")
453
528
  subprocess.run(["docker", "compose", "up", "-d", "web"], capture_output=True)
454
- time.sleep(5)
455
529
 
456
530
  odoo_container = _get_odoo_container_name(project_dir)
457
531
  if odoo_container:
458
- _restore_filestore(odoo_container, filestore_tar, restored_db)
532
+ volume_ready = _wait_for_odoo_volume(odoo_container)
533
+ if volume_ready:
534
+ _restore_filestore(odoo_container, filestore_tar, restored_db)
535
+ else:
536
+ console.print(
537
+ "[yellow]⚠[/yellow] Skipping filestore restore: "
538
+ "Odoo volume was not ready in time.\n"
539
+ "[dim] Try running the restore manually after the environment is up.[/dim]"
540
+ )
459
541
 
460
542
  _launch_environment(build=build)
461
543
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rocketdoo
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: Framework for creating Odoo development environments with Docker and custom templates.
5
5
  Author-email: Horacio Montaño <horaciomontano@hdmsoft.com.ar>
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -62,7 +62,7 @@ License: GNU LESSER GENERAL PUBLIC LICENSE
62
62
  <div RKD as ROCKETDOO V2=""></div>
63
63
 
64
64
  Licencia: LGPL-3.0+
65
- Versión: "2.3.0"
65
+ Versión: "2.3.1"
66
66
  Autor: Horacio Montaño, Elias Braceras
67
67
  Fecha: 16/10/2024
68
68
  Descripción: Framework to development Odoo
@@ -95,7 +95,7 @@ Odoo Development Framework
95
95
  - "Horacio Montaño" and "Elias Braceras"
96
96
 
97
97
  ## Version:
98
- - "2.3.0"
98
+ - "2.3.1"
99
99
 
100
100
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
101
101
 
File without changes
File without changes
File without changes
File without changes
File without changes