opsmith-cli 0.4.3b0__tar.gz → 0.4.4b0__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.
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/PKG-INFO +1 -1
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/deployment_strategies/base.py +48 -41
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/deployment_strategies/monolithic.py +34 -8
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/git_repo.py +16 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/pyproject.toml +1 -1
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/.flake8 +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/.github/workflows/python-publish.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/.gitignore +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/.pre-commit-config.yaml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/CONVENTIONS.md +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/LICENSE.txt +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/README.md +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/__init__.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/agent.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/cloud_providers/__init__.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/cloud_providers/aws.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/cloud_providers/base.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/cloud_providers/gcp.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/constants.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/deployment_strategies/__init__.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/exceptions.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/__init__.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/ansible_provisioner.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/base_provisioner.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/terraform_provisioner.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/main.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/models.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/prompts.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/README.md +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/arduino-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/c-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/c_sharp-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/chatito-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/commonlisp-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/cpp-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/csharp-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/d-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/dart-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elisp-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elixir-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elm-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/gleam-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/go-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/hcl-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/java-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/javascript-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/kotlin-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/lua-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ocaml-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ocaml_interface-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/php-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/pony-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/properties-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/python-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ql-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/r-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/racket-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ruby-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/rust-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/scala-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/solidity-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/swift-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/typescript-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/udev-tags.scm +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/repo_map.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/service_detector.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/settings.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/cloud_storage_cleanup/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/cloud_storage_cleanup/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_build_push/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_build_push/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/aws/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/gcp/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/aws/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/gcp/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/base.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/elasticsearch.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/kafka.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/mongodb.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/mysql.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/postgresql.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/rabbitmq.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/redis.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/services/backend_api.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/services/backend_worker.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/services/full_stack.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/traefik.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/weaviate.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/dockerfiles/python_backend_api +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/dockerfiles/python_backend_worker +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/aws/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/gcp/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/aws/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/aws/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/aws/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/gcp/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/gcp/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_cdn/gcp/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_deploy/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_deploy/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/aws/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/aws/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/aws/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/gcp/main.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/gcp/outputs.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/gcp/variables.tf +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/aws/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/aws/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/gcp/inventory.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/gcp/main.yml +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/tests/__init__.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/tests/test_service_detector.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/types.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/utils.py +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/resources/deploy_demo.gif +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/resources/deploy_demo.svg +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/resources/setup_demo.gif +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/resources/setup_demo.svg +0 -0
- {opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/uv.lock +0 -0
|
@@ -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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
|
|
@@ -906,22 +906,48 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
906
906
|
|
|
907
907
|
if other_services:
|
|
908
908
|
if env_state.virtual_machine:
|
|
909
|
-
self._build_and_push_images(
|
|
909
|
+
images = self._build_and_push_images(
|
|
910
|
+
deployment_config, environment, env_state.registry_url
|
|
911
|
+
)
|
|
910
912
|
|
|
911
|
-
|
|
913
|
+
ansible_user = env_state.virtual_machine.user
|
|
914
|
+
env_file_path = f"/home/{ansible_user}/app/.env"
|
|
915
|
+
docker_compose_file_path = f"/home/{ansible_user}/app/docker-compose.yml"
|
|
912
916
|
fetched_files = self._fetch_remote_deployment_files(
|
|
913
917
|
deployment_config,
|
|
914
918
|
environment,
|
|
915
919
|
env_state.virtual_machine,
|
|
916
|
-
[env_file_path],
|
|
920
|
+
[env_file_path, docker_compose_file_path],
|
|
917
921
|
)
|
|
922
|
+
existing_env_content = fetched_files[0]
|
|
923
|
+
existing_compose_content = fetched_files[1]
|
|
918
924
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
env_state,
|
|
923
|
-
fetched_files[0],
|
|
925
|
+
docker_compose_content = DockerComposeContent(
|
|
926
|
+
content=existing_compose_content,
|
|
927
|
+
env_file_content=existing_env_content,
|
|
924
928
|
)
|
|
929
|
+
|
|
930
|
+
is_successful, reason, _, confirmed_env_content = (
|
|
931
|
+
self._deploy_validate_docker_compose(
|
|
932
|
+
deployment_config,
|
|
933
|
+
environment,
|
|
934
|
+
env_state,
|
|
935
|
+
docker_compose_content,
|
|
936
|
+
)
|
|
937
|
+
)
|
|
938
|
+
|
|
939
|
+
if is_successful:
|
|
940
|
+
print("[bold green]Release deployed successfully.[/bold green]")
|
|
941
|
+
else:
|
|
942
|
+
print(f"[red]Deployment validation failed:[/red] {reason}")
|
|
943
|
+
print("\n[bold blue]Regenerating docker-compose configuration...[/bold blue]")
|
|
944
|
+
self._generate_docker_compose(
|
|
945
|
+
deployment_config,
|
|
946
|
+
environment,
|
|
947
|
+
images,
|
|
948
|
+
env_state,
|
|
949
|
+
existing_env_content=confirmed_env_content,
|
|
950
|
+
)
|
|
925
951
|
else:
|
|
926
952
|
# This can happen if only frontend was deployed
|
|
927
953
|
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"
|
|
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
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/ansible_provisioner.py
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/infra_provisioners/terraform_provisioner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/arduino-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/c-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/c_sharp-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/chatito-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/cpp-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/csharp-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/d-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/dart-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elisp-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elixir-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/elm-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/gleam-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/go-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/hcl-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/java-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/kotlin-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/lua-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ocaml-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/php-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/pony-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/python-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ql-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/r-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/racket-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/ruby-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/rust-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/scala-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/solidity-tags.scm
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/swift-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/queries/tree-sitter-languages/udev-tags.scm
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/cloud_storage_cleanup/aws/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/cloud_storage_cleanup/gcp/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/main.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/aws/variables.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/main.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/container_registry/gcp/variables.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_build_push/aws/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_build_push/gcp/main.yml
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/aws/main.yml
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_deploy/gcp/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/aws/inventory.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/aws/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/gcp/inventory.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_run/gcp/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/base.yml
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/kafka.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/mongodb.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/mysql.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/postgresql.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/rabbitmq.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/redis.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/traefik.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/docker_compose_snippets/weaviate.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/dockerfiles/python_backend_api
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/dockerfiles/python_backend_worker
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/aws/inventory.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/aws/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/gcp/inventory.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/fetch_remote_files/gcp/main.yml
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/main.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/aws/variables.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/main.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/frontend_bucket_cert/gcp/variables.tf
RENAMED
|
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
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/aws/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/aws/variables.tf
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/gcp/outputs.tf
RENAMED
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine/gcp/variables.tf
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/aws/main.yml
RENAMED
|
File without changes
|
|
File without changes
|
{opsmith_cli-0.4.3b0 → opsmith_cli-0.4.4b0}/opsmith/templates/virtual_machine_setup/gcp/main.yml
RENAMED
|
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
|