opsmith-cli 0.4.3b0__tar.gz → 0.4.5b0__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 (137) hide show
  1. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/PKG-INFO +1 -1
  2. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/deployment_strategies/base.py +48 -41
  3. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/deployment_strategies/monolithic.py +42 -11
  4. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/git_repo.py +16 -0
  5. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/models.py +1 -1
  6. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine_setup/aws/main.yml +6 -0
  7. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/types.py +5 -6
  8. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/pyproject.toml +1 -1
  9. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/.flake8 +0 -0
  10. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/.github/workflows/python-publish.yml +0 -0
  11. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/.gitignore +0 -0
  12. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/.pre-commit-config.yaml +0 -0
  13. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/CONVENTIONS.md +0 -0
  14. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/LICENSE.txt +0 -0
  15. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/README.md +0 -0
  16. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/__init__.py +0 -0
  17. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/agent.py +0 -0
  18. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/cloud_providers/__init__.py +0 -0
  19. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/cloud_providers/aws.py +0 -0
  20. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/cloud_providers/base.py +0 -0
  21. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/cloud_providers/gcp.py +0 -0
  22. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/constants.py +0 -0
  23. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/deployment_strategies/__init__.py +0 -0
  24. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/exceptions.py +0 -0
  25. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/infra_provisioners/__init__.py +0 -0
  26. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/infra_provisioners/ansible_provisioner.py +0 -0
  27. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/infra_provisioners/base_provisioner.py +0 -0
  28. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/infra_provisioners/terraform_provisioner.py +0 -0
  29. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/main.py +0 -0
  30. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/prompts.py +0 -0
  31. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/README.md +0 -0
  32. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/arduino-tags.scm +0 -0
  33. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/c-tags.scm +0 -0
  34. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/c_sharp-tags.scm +0 -0
  35. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/chatito-tags.scm +0 -0
  36. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/commonlisp-tags.scm +0 -0
  37. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/cpp-tags.scm +0 -0
  38. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/csharp-tags.scm +0 -0
  39. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/d-tags.scm +0 -0
  40. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/dart-tags.scm +0 -0
  41. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/elisp-tags.scm +0 -0
  42. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/elixir-tags.scm +0 -0
  43. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/elm-tags.scm +0 -0
  44. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/gleam-tags.scm +0 -0
  45. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/go-tags.scm +0 -0
  46. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/hcl-tags.scm +0 -0
  47. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/java-tags.scm +0 -0
  48. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/javascript-tags.scm +0 -0
  49. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/kotlin-tags.scm +0 -0
  50. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/lua-tags.scm +0 -0
  51. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/ocaml-tags.scm +0 -0
  52. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/ocaml_interface-tags.scm +0 -0
  53. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/php-tags.scm +0 -0
  54. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/pony-tags.scm +0 -0
  55. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/properties-tags.scm +0 -0
  56. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/python-tags.scm +0 -0
  57. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/ql-tags.scm +0 -0
  58. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/r-tags.scm +0 -0
  59. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/racket-tags.scm +0 -0
  60. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/ruby-tags.scm +0 -0
  61. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/rust-tags.scm +0 -0
  62. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/scala-tags.scm +0 -0
  63. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/solidity-tags.scm +0 -0
  64. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/swift-tags.scm +0 -0
  65. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/typescript-tags.scm +0 -0
  66. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/queries/tree-sitter-languages/udev-tags.scm +0 -0
  67. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/repo_map.py +0 -0
  68. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/service_detector.py +0 -0
  69. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/settings.py +0 -0
  70. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/cloud_storage_cleanup/aws/main.yml +0 -0
  71. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/cloud_storage_cleanup/gcp/main.yml +0 -0
  72. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/aws/main.tf +0 -0
  73. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/aws/outputs.tf +0 -0
  74. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/aws/variables.tf +0 -0
  75. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/gcp/main.tf +0 -0
  76. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/gcp/outputs.tf +0 -0
  77. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/container_registry/gcp/variables.tf +0 -0
  78. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_build_push/aws/main.yml +0 -0
  79. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_build_push/gcp/main.yml +0 -0
  80. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_deploy/aws/inventory.yml +0 -0
  81. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_deploy/aws/main.yml +0 -0
  82. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_deploy/gcp/inventory.yml +0 -0
  83. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_deploy/gcp/main.yml +0 -0
  84. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_run/aws/inventory.yml +0 -0
  85. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_run/aws/main.yml +0 -0
  86. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_run/gcp/inventory.yml +0 -0
  87. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_run/gcp/main.yml +0 -0
  88. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/base.yml +0 -0
  89. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/elasticsearch.yml +0 -0
  90. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/kafka.yml +0 -0
  91. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/mongodb.yml +0 -0
  92. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/mysql.yml +0 -0
  93. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/postgresql.yml +0 -0
  94. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/rabbitmq.yml +0 -0
  95. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/redis.yml +0 -0
  96. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/services/backend_api.yml +0 -0
  97. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/services/backend_worker.yml +0 -0
  98. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/services/full_stack.yml +0 -0
  99. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/traefik.yml +0 -0
  100. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/docker_compose_snippets/weaviate.yml +0 -0
  101. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/dockerfiles/python_backend_api +0 -0
  102. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/dockerfiles/python_backend_worker +0 -0
  103. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/fetch_remote_files/aws/inventory.yml +0 -0
  104. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/fetch_remote_files/aws/main.yml +0 -0
  105. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/fetch_remote_files/gcp/inventory.yml +0 -0
  106. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/fetch_remote_files/gcp/main.yml +0 -0
  107. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/aws/main.tf +0 -0
  108. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/aws/outputs.tf +0 -0
  109. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/aws/variables.tf +0 -0
  110. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/gcp/main.tf +0 -0
  111. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/gcp/outputs.tf +0 -0
  112. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_bucket_cert/gcp/variables.tf +0 -0
  113. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/aws/main.tf +0 -0
  114. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/aws/outputs.tf +0 -0
  115. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/aws/variables.tf +0 -0
  116. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/gcp/main.tf +0 -0
  117. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/gcp/outputs.tf +0 -0
  118. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_cdn/gcp/variables.tf +0 -0
  119. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_deploy/aws/main.yml +0 -0
  120. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/frontend_deploy/gcp/main.yml +0 -0
  121. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/aws/main.tf +0 -0
  122. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/aws/outputs.tf +0 -0
  123. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/aws/variables.tf +0 -0
  124. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/gcp/main.tf +0 -0
  125. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/gcp/outputs.tf +0 -0
  126. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine/gcp/variables.tf +0 -0
  127. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine_setup/aws/inventory.yml +0 -0
  128. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine_setup/gcp/inventory.yml +0 -0
  129. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/templates/virtual_machine_setup/gcp/main.yml +0 -0
  130. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/tests/__init__.py +0 -0
  131. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/tests/test_service_detector.py +0 -0
  132. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/opsmith/utils.py +0 -0
  133. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/resources/deploy_demo.gif +0 -0
  134. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/resources/deploy_demo.svg +0 -0
  135. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/resources/setup_demo.gif +0 -0
  136. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/resources/setup_demo.svg +0 -0
  137. {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.5b0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opsmith-cli
3
- Version: 0.4.3b0
3
+ Version: 0.4.5b0
4
4
  Summary: Opsmith is an AI devops engineer in your terminal
5
5
  License-Expression: GPL-3.0-only
6
6
  License-File: LICENSE.txt
@@ -14,6 +14,7 @@ from rich import print
14
14
 
15
15
  from opsmith.agent import AgentDeps
16
16
  from opsmith.cloud_providers.base import BaseCloudProvider, MachineType
17
+ from opsmith.git_repo import GitRepo
17
18
  from opsmith.infra_provisioners.ansible_provisioner import AnsibleProvisioner
18
19
  from opsmith.infra_provisioners.terraform_provisioner import TerraformProvisioner
19
20
  from opsmith.settings import settings
@@ -105,6 +106,7 @@ class BaseDeploymentStrategy(abc.ABC):
105
106
  self.src_dir = src_dir
106
107
  self.deployments_path = src_dir.joinpath(settings.deployments_dir)
107
108
  self.templates_dir = Path(__file__).parent.parent / "templates"
109
+ self.git_repo = GitRepo(self.src_dir)
108
110
 
109
111
  def _get_env_state_path(self, environment_name: str) -> Path:
110
112
  return self.deployments_path / "environments" / environment_name / "state.yml"
@@ -176,54 +178,59 @@ class BaseDeploymentStrategy(abc.ABC):
176
178
  ServiceTypeEnum.BACKEND_WORKER,
177
179
  ]
178
180
 
179
- for service in deployment_config.services:
180
- if service.service_type not in buildable_service_types:
181
- continue
182
-
183
- # This logic is from generate_dockerfiles
184
- service_dir_slug = service.name_slug
185
- dockerfile_path_abs = self.deployments_path / "docker" / service_dir_slug / "Dockerfile"
181
+ with self.git_repo.git_archive_context() as clean_context_path:
182
+ for service in deployment_config.services:
183
+ if service.service_type not in buildable_service_types:
184
+ continue
186
185
 
187
- if not dockerfile_path_abs.exists():
188
- print(
189
- f"[bold yellow]Dockerfile for {service_dir_slug} not found at"
190
- f" {dockerfile_path_abs}, skipping build.[/bold yellow]"
186
+ # This logic is from generate_dockerfiles
187
+ service_dir_slug = service.name_slug
188
+ dockerfile_path_abs = (
189
+ self.deployments_path / "docker" / service_dir_slug / "Dockerfile"
191
190
  )
192
- continue
193
-
194
- image_name_slug = service_dir_slug
195
191
 
196
- print(f"\n[bold]Building and pushing image for {image_name_slug}...[/bold]")
192
+ if not dockerfile_path_abs.exists():
193
+ print(
194
+ f"[bold yellow]Dockerfile for {service_dir_slug} not found at"
195
+ f" {dockerfile_path_abs}, skipping build.[/bold yellow]"
196
+ )
197
+ continue
197
198
 
198
- build_infra_path = (
199
- self.deployments_path
200
- / "environments"
201
- / environment.name
202
- / "docker_build_push"
203
- / image_name_slug
204
- )
205
-
206
- ansible_runner = AnsibleProvisioner(working_dir=build_infra_path)
207
-
208
- provider_name = environment.cloud_provider_detail.name.lower()
199
+ image_name_slug = service_dir_slug
209
200
 
210
- extra_vars = {
211
- "docker_path": str(self.agent_deps.src_dir),
212
- "dockerfile_path": str(dockerfile_path_abs),
213
- "image_name_slug": image_name_slug,
214
- "image_tag_name": "latest",
215
- "registry_url": registry_url,
216
- }
217
- extra_vars.update(environment.cloud_provider_instance.provider_detail_dump)
218
- ansible_runner.copy_template("docker_build_push", provider_name)
219
- outputs = ansible_runner.run_playbook("main.yml", extra_vars)
201
+ print(f"\n[bold]Building and pushing image for {image_name_slug}...[/bold]")
220
202
 
221
- print(f"[green]Successfully built and pushed image for {image_name_slug}[/green]")
203
+ build_infra_path = (
204
+ self.deployments_path
205
+ / "environments"
206
+ / environment.name
207
+ / "docker_build_push"
208
+ / image_name_slug
209
+ )
222
210
 
223
- if "image_url" in outputs:
224
- images[image_name_slug] = outputs["image_url"]
225
- else:
226
- print(f"[bold red]Could not determine image URL for {image_name_slug}[/bold red]")
211
+ ansible_runner = AnsibleProvisioner(working_dir=build_infra_path)
212
+
213
+ provider_name = environment.cloud_provider_detail.name.lower()
214
+
215
+ extra_vars = {
216
+ "docker_path": str(clean_context_path),
217
+ "dockerfile_path": str(dockerfile_path_abs),
218
+ "image_name_slug": image_name_slug,
219
+ "image_tag_name": "latest",
220
+ "registry_url": registry_url,
221
+ }
222
+ extra_vars.update(environment.cloud_provider_instance.provider_detail_dump)
223
+ ansible_runner.copy_template("docker_build_push", provider_name)
224
+ outputs = ansible_runner.run_playbook("main.yml", extra_vars)
225
+
226
+ print(f"[green]Successfully built and pushed image for {image_name_slug}[/green]")
227
+
228
+ if "image_url" in outputs:
229
+ images[image_name_slug] = outputs["image_url"]
230
+ else:
231
+ print(
232
+ f"[bold red]Could not determine image URL for {image_name_slug}[/bold red]"
233
+ )
227
234
 
228
235
  return images
229
236
 
@@ -105,13 +105,16 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
105
105
  # Parse env_file_content from LLM
106
106
  env_file_vars = dotenv_values(stream=StringIO(env_file_content))
107
107
 
108
- env_defaults = deployment_config.get_env_var_defaults()
108
+ configured_env = deployment_config.get_configured_env_vars()
109
109
 
110
110
  # Prepare questions for inquirer
111
111
  questions = []
112
112
  for key, value in sorted(env_file_vars.items()):
113
+ # Exclude any custom env that is not configured
114
+ if key not in configured_env:
115
+ continue
113
116
  # Precedence: llm > code default
114
- default_value = value or env_defaults.get(key)
117
+ default_value = value or configured_env[key]
115
118
  questions.append(
116
119
  inquirer.Text(
117
120
  name=key,
@@ -238,6 +241,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
238
241
  images: Dict[str, str],
239
242
  environment_state: MonolithicDeploymentState,
240
243
  existing_env_content: Optional[str] = None,
244
+ initial_messages: Optional[list[ModelMessage]] = None,
241
245
  ):
242
246
  base_compose_template = self.docker_compose_snippets_env.get_template("base.yml")
243
247
  base_compose = base_compose_template.render(app_name=deployment_config.app_name_slug)
@@ -293,7 +297,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
293
297
  confirmed_env_content = existing_env_content or "N/A"
294
298
  is_successful = False
295
299
  docker_compose_content = None
296
- messages = []
300
+ messages = initial_messages or []
297
301
  for attempt in range(settings.max_docker_compose_gen_attempts):
298
302
  print(
299
303
  "\n[bold blue]Generating docker-compose file, Attempt"
@@ -906,22 +910,49 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
906
910
 
907
911
  if other_services:
908
912
  if env_state.virtual_machine:
909
- self._build_and_push_images(deployment_config, environment, env_state.registry_url)
913
+ images = self._build_and_push_images(
914
+ deployment_config, environment, env_state.registry_url
915
+ )
910
916
 
911
- env_file_path = f"/home/{env_state.virtual_machine.user}/app/.env"
917
+ ansible_user = env_state.virtual_machine.user
918
+ env_file_path = f"/home/{ansible_user}/app/.env"
919
+ docker_compose_file_path = f"/home/{ansible_user}/app/docker-compose.yml"
912
920
  fetched_files = self._fetch_remote_deployment_files(
913
921
  deployment_config,
914
922
  environment,
915
923
  env_state.virtual_machine,
916
- [env_file_path],
924
+ [env_file_path, docker_compose_file_path],
917
925
  )
926
+ existing_env_content = fetched_files[0]
927
+ existing_compose_content = fetched_files[1]
918
928
 
919
- self._deploy_docker_compose(
920
- deployment_config,
921
- environment,
922
- env_state,
923
- fetched_files[0],
929
+ docker_compose_content = DockerComposeContent(
930
+ content=existing_compose_content,
931
+ env_file_content=existing_env_content,
932
+ )
933
+
934
+ is_successful, reason, validation_messages, confirmed_env_content = (
935
+ self._deploy_validate_docker_compose(
936
+ deployment_config,
937
+ environment,
938
+ env_state,
939
+ docker_compose_content,
940
+ )
924
941
  )
942
+
943
+ if is_successful:
944
+ print("[bold green]Release deployed successfully.[/bold green]")
945
+ else:
946
+ print(f"[red]Deployment validation failed:[/red] {reason}")
947
+ print("\n[bold blue]Regenerating docker-compose configuration...[/bold blue]")
948
+ self._generate_docker_compose(
949
+ deployment_config,
950
+ environment,
951
+ images,
952
+ env_state,
953
+ existing_env_content=confirmed_env_content,
954
+ initial_messages=validation_messages,
955
+ )
925
956
  else:
926
957
  # This can happen if only frontend was deployed
927
958
  print(
@@ -1,3 +1,7 @@
1
+ import io
2
+ import tarfile
3
+ import tempfile
4
+ from contextlib import contextmanager
1
5
  from pathlib import Path
2
6
  from typing import List
3
7
 
@@ -65,6 +69,18 @@ class GitRepo:
65
69
  absolute_paths = [git_root / p for p in relative_paths if p]
66
70
  return absolute_paths
67
71
 
72
+ @contextmanager
73
+ def git_archive_context(self):
74
+ """Creates a clean build context from git-tracked files only."""
75
+ print("Creating build context from git-tracked files...")
76
+ with tempfile.TemporaryDirectory() as temp_dir:
77
+ buf = io.BytesIO()
78
+ self.repo.archive(buf, format="tar")
79
+ buf.seek(0)
80
+ with tarfile.open(fileobj=buf) as tar:
81
+ tar.extractall(path=temp_dir)
82
+ yield Path(temp_dir)
83
+
68
84
  def ensure_gitignore(self):
69
85
  """Ensures that Terraform state files are included in .gitignore."""
70
86
  gitignore_path = Path(self.repo.working_dir) / ".gitignore"
@@ -263,7 +263,7 @@ class GoogleGlaGemini25Pro(BaseAiModel):
263
263
  class GoogleGlaGemini3Pro(BaseAiModel):
264
264
  @classmethod
265
265
  def name(cls) -> str:
266
- return "gemini-3-pro-preview"
266
+ return "gemini-3.1-pro-preview"
267
267
 
268
268
  @classmethod
269
269
  def provider(cls) -> str:
@@ -150,6 +150,12 @@
150
150
  groups: systemd-journal
151
151
  append: yes
152
152
 
153
+ - name: Start Vector service
154
+ ansible.builtin.service:
155
+ name: vector
156
+ state: started
157
+ enabled: yes
158
+
153
159
  - name: Create CloudWatch agent configuration
154
160
  ansible.builtin.copy:
155
161
  content: |
@@ -225,14 +225,13 @@ class DeploymentConfig(ServiceList):
225
225
  return env
226
226
  raise ValueError(f"Environment '{name}' not found in the deployment configuration.")
227
227
 
228
- def get_env_var_defaults(self) -> dict:
229
- """Retrieves a dictionary of environment variable defaults."""
230
- env_var_defaults = {}
228
+ def get_configured_env_vars(self) -> dict:
229
+ """Retrieves a dictionary of configured environment variable with defaults."""
230
+ env_vars = {}
231
231
  for service in self.services:
232
232
  for env_var in service.env_vars:
233
- if env_var.default_value:
234
- env_var_defaults[env_var.key] = env_var.default_value
235
- return env_var_defaults
233
+ env_vars[env_var.key] = env_var.default_value
234
+ return env_vars
236
235
 
237
236
  @classmethod
238
237
  def load(cls: Type["DeploymentConfig"], deployments_path: Path) -> Optional["DeploymentConfig"]:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "opsmith-cli"
3
- version = "0.4.3b"
3
+ version = "0.4.5b"
4
4
  description = "Opsmith is an AI devops engineer in your terminal"
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  classifiers = [
File without changes
File without changes
File without changes
File without changes
File without changes