djaploy 1.2.4__tar.gz → 1.2.5__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 (91) hide show
  1. {djaploy-1.2.4 → djaploy-1.2.5}/PKG-INFO +1 -1
  2. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/borg/infra/djaploy_hooks.py +24 -2
  3. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/infra/djaploy_hooks.py +1 -0
  4. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/PKG-INFO +1 -1
  5. {djaploy-1.2.4 → djaploy-1.2.5}/pyproject.toml +1 -1
  6. {djaploy-1.2.4 → djaploy-1.2.5}/LICENSE +0 -0
  7. {djaploy-1.2.4 → djaploy-1.2.5}/README.md +0 -0
  8. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/__init__.py +0 -0
  9. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/app.py +0 -0
  10. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/__init__.py +0 -0
  11. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/borg/__init__.py +0 -0
  12. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/borg/infra/__init__.py +0 -0
  13. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/janitor/__init__.py +0 -0
  14. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/janitor/apps.py +0 -0
  15. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/janitor/infra/__init__.py +0 -0
  16. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/janitor/infra/commands/createjanitoruser.py +0 -0
  17. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/janitor/infra/djaploy_hooks.py +0 -0
  18. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/nginx/__init__.py +0 -0
  19. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/nginx/apps.py +0 -0
  20. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/nginx/infra/__init__.py +0 -0
  21. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/nginx/infra/djaploy_hooks.py +0 -0
  22. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/rclone/__init__.py +0 -0
  23. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/rclone/apps.py +0 -0
  24. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/rclone/infra/__init__.py +0 -0
  25. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/rclone/infra/djaploy_hooks.py +0 -0
  26. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/sync_certs/__init__.py +0 -0
  27. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/sync_certs/apps.py +0 -0
  28. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/sync_certs/infra/__init__.py +0 -0
  29. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/sync_certs/infra/djaploy_hooks.py +0 -0
  30. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/systemd/__init__.py +0 -0
  31. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/systemd/apps.py +0 -0
  32. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/systemd/infra/__init__.py +0 -0
  33. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/systemd/infra/djaploy_hooks.py +0 -0
  34. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/tailscale/__init__.py +0 -0
  35. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/tailscale/apps.py +0 -0
  36. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/tailscale/infra/__init__.py +0 -0
  37. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/tailscale/infra/djaploy_hooks.py +0 -0
  38. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/versioning/__init__.py +0 -0
  39. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/versioning/apps.py +0 -0
  40. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/versioning/infra/__init__.py +0 -0
  41. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/apps/versioning/infra/djaploy_hooks.py +0 -0
  42. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/artifact.py +0 -0
  43. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/bin/__init__.py +0 -0
  44. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/bin/django_pyinfra.py +0 -0
  45. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/bin/gunicornherder.py +0 -0
  46. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/builtin_hooks.py +0 -0
  47. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/certificates.py +0 -0
  48. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/changelog.py +0 -0
  49. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/__init__.py +0 -0
  50. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/_utils.py +0 -0
  51. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/activate.py +0 -0
  52. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/configure.py +0 -0
  53. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/deploy.py +0 -0
  54. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/restore.py +0 -0
  55. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/rollback.py +0 -0
  56. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/status.py +0 -0
  57. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/commands/sync_certs.py +0 -0
  58. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/config.py +0 -0
  59. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/deploy.py +0 -0
  60. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/discovery.py +0 -0
  61. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/hooks.py +0 -0
  62. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/infra/__init__.py +0 -0
  63. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/infra/bluegreen.py +0 -0
  64. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/infra/templates.py +0 -0
  65. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/infra/utils.py +0 -0
  66. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/__init__.py +0 -0
  67. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/__init__.py +0 -0
  68. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/djaploy.py +0 -0
  69. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/restore_backup.py +0 -0
  70. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/sync_certs.py +0 -0
  71. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/update_certs.py +0 -0
  72. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/commands/verify.py +0 -0
  73. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/management/utils.py +0 -0
  74. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/notifications.py +0 -0
  75. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/utils.py +0 -0
  76. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/version.py +0 -0
  77. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy/versioning.py +0 -0
  78. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/SOURCES.txt +0 -0
  79. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/dependency_links.txt +0 -0
  80. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/entry_points.txt +0 -0
  81. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/requires.txt +0 -0
  82. {djaploy-1.2.4 → djaploy-1.2.5}/djaploy.egg-info/top_level.txt +0 -0
  83. {djaploy-1.2.4 → djaploy-1.2.5}/setup.cfg +0 -0
  84. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_bluegreen.py +0 -0
  85. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_borg.py +0 -0
  86. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_config.py +0 -0
  87. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_deploy_scripts.py +0 -0
  88. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_discovery.py +0 -0
  89. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_gunicornherder.py +0 -0
  90. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_hooks.py +0 -0
  91. {djaploy-1.2.4 → djaploy-1.2.5}/tests/test_versioning.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djaploy
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: Modular Django deployment system based on pyinfra
5
5
  Author-email: Johanna Mae Dimayuga <johanna@techco.fi>
6
6
  License: MIT License
@@ -146,7 +146,7 @@ def _generate_backup_script(borg_config, app_user: str, repo_name: str,
146
146
  if not isinstance(host_data, dict)
147
147
  else host_data.get('deployment_strategy', 'zero_downtime')
148
148
  )
149
- if deployment_strategy == 'zero_downtime':
149
+ if deployment_strategy in ('zero_downtime', 'bluegreen'):
150
150
  default_media = f"/home/{app_user}/apps/{app_name}/shared/media"
151
151
  else:
152
152
  default_media = f"/home/{app_user}/apps/{app_name}/media"
@@ -527,7 +527,7 @@ def restore_borg(host_data, restore_opts):
527
527
  if not isinstance(host_data, dict)
528
528
  else host_data.get('deployment_strategy', 'zero_downtime')
529
529
  )
530
- if deployment_strategy == 'zero_downtime':
530
+ if deployment_strategy in ('zero_downtime', 'bluegreen'):
531
531
  default_media = f"/home/{app_user}/apps/{app_name}/shared/media"
532
532
  else:
533
533
  default_media = f"/home/{app_user}/apps/{app_name}/media"
@@ -540,6 +540,28 @@ def restore_borg(host_data, restore_opts):
540
540
  db_only = restore_opts.get("db_only", False)
541
541
  services = getattr(host_data, "services", None) or []
542
542
 
543
+ # For bluegreen, expand service names to per-slot services and include
544
+ # per-slot streaming services so they are also stopped during restore.
545
+ deployment_strategy = (
546
+ getattr(host_data, 'deployment_strategy', 'zero_downtime')
547
+ if not isinstance(host_data, dict)
548
+ else host_data.get('deployment_strategy', 'zero_downtime')
549
+ )
550
+ if deployment_strategy == 'bluegreen':
551
+ app_name = (
552
+ getattr(host_data, 'app_name', '')
553
+ if not isinstance(host_data, dict)
554
+ else host_data.get('app_name', '')
555
+ )
556
+ bluegreen_services = []
557
+ for svc in services:
558
+ bluegreen_services.append(f"{app_name}-blue")
559
+ bluegreen_services.append(f"{app_name}-green")
560
+ # Also stop streaming coordinator instances
561
+ bluegreen_services.append(f"{app_name}-streaming-blue")
562
+ bluegreen_services.append(f"{app_name}-streaming-green")
563
+ services = bluegreen_services
564
+
543
565
  # Repo connection details come from the *source* borg config, but
544
566
  # ssh_known_hosts_file must come from the *target* (the file lives on
545
567
  # the machine running borg, not the machine the backup was taken from).
@@ -160,6 +160,7 @@ def configure_server(host_data):
160
160
  _sudo_user=app_user,
161
161
  )
162
162
 
163
+
163
164
  shared_resources = getattr(host_data, 'shared_resources', None) or []
164
165
  if shared_resources:
165
166
  mkdir_commands = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djaploy
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: Modular Django deployment system based on pyinfra
5
5
  Author-email: Johanna Mae Dimayuga <johanna@techco.fi>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "djaploy"
3
- version = "1.2.4"
3
+ version = "1.2.5"
4
4
  description = "Modular Django deployment system based on pyinfra"
5
5
  authors = [
6
6
  {name = "Johanna Mae Dimayuga", email = "johanna@techco.fi"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes