opsmith-cli 0.3.0b0__tar.gz → 0.3.1b0__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.3.0b0 → opsmith_cli-0.3.1b0}/PKG-INFO +1 -1
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/deployment_strategies/base.py +3 -3
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/deployment_strategies/monolithic.py +5 -5
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/main.py +31 -31
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/pyproject.toml +1 -1
- opsmith_cli-0.3.1b0/resources/deploy_demo.gif +0 -0
- opsmith_cli-0.3.1b0/resources/deploy_demo.svg +1 -0
- opsmith_cli-0.3.0b0/resources/deploy_demo.svg +0 -1
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/.flake8 +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/.github/workflows/python-publish.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/.gitignore +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/.pre-commit-config.yaml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/CONVENTIONS.md +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/LICENSE.txt +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/README.md +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/__init__.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/agent.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/cloud_providers/__init__.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/cloud_providers/aws.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/cloud_providers/base.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/cloud_providers/gcp.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/constants.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/deployment_strategies/__init__.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/exceptions.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/git_repo.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/infra_provisioners/__init__.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/infra_provisioners/ansible_provisioner.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/infra_provisioners/base_provisioner.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/infra_provisioners/terraform_provisioner.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/models.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/prompts.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/README.md +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/arduino-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/c-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/c_sharp-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/chatito-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/commonlisp-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/cpp-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/csharp-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/d-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/dart-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/elisp-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/elixir-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/elm-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/gleam-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/go-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/hcl-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/java-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/javascript-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/kotlin-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/lua-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/ocaml-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/ocaml_interface-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/php-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/pony-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/properties-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/python-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/ql-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/r-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/racket-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/ruby-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/rust-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/scala-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/solidity-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/swift-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/typescript-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/queries/tree-sitter-languages/udev-tags.scm +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/repo_map.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/service_detector.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/settings.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/cloud_storage_cleanup/aws/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/cloud_storage_cleanup/gcp/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/aws/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/aws/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/aws/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/gcp/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/gcp/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/container_registry/gcp/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_build_push/aws/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_build_push/gcp/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_deploy/aws/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_deploy/gcp/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_run/common/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/base.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/elasticsearch.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/kafka.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/mongodb.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/mysql.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/postgresql.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/rabbitmq.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/redis.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/services/backend_api.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/services/backend_worker.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/services/full_stack.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/traefik.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_compose_snippets/weaviate.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_setup/aws/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/docker_setup/gcp/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/dockerfiles/python_backend_api +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/dockerfiles/python_backend_worker +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/fetch_remote_files/common/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/aws/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/aws/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/aws/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/gcp/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/gcp/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_bucket_cert/gcp/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/aws/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/aws/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/aws/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/gcp/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/gcp/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_cdn/gcp/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_deploy/aws/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/frontend_deploy/gcp/main.yml +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/aws/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/aws/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/aws/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/gcp/main.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/gcp/outputs.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/templates/virtual_machine/gcp/variables.tf +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/types.py +7 -7
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/opsmith/utils.py +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/resources/setup_demo.gif +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/resources/setup_demo.svg +0 -0
- {opsmith_cli-0.3.0b0 → opsmith_cli-0.3.1b0}/uv.lock +0 -0
|
@@ -113,14 +113,14 @@ class BaseDeploymentStrategy(abc.ABC):
|
|
|
113
113
|
# Registry name should probably be unique per region for the app
|
|
114
114
|
registry_name = slugify(f"{app_name}-{environment.region}")
|
|
115
115
|
|
|
116
|
-
cloud_provider_instance =
|
|
116
|
+
cloud_provider_instance = environment.cloud_provider_instance
|
|
117
117
|
provider_name = cloud_provider_instance.name()
|
|
118
118
|
|
|
119
119
|
registry_infra_path = (
|
|
120
120
|
self.deployments_path
|
|
121
121
|
/ "environments"
|
|
122
122
|
/ "global"
|
|
123
|
-
/ environment.region
|
|
123
|
+
/ f"{cloud_provider_instance.name()}-{environment.region}"
|
|
124
124
|
/ "container_registry"
|
|
125
125
|
)
|
|
126
126
|
tf = TerraformProvisioner(working_dir=registry_infra_path)
|
|
@@ -201,7 +201,7 @@ class BaseDeploymentStrategy(abc.ABC):
|
|
|
201
201
|
|
|
202
202
|
ansible_runner = AnsibleProvisioner(working_dir=build_infra_path)
|
|
203
203
|
|
|
204
|
-
provider_name =
|
|
204
|
+
provider_name = environment.cloud_provider["name"].lower()
|
|
205
205
|
|
|
206
206
|
extra_vars = {
|
|
207
207
|
"docker_path": str(self.agent_deps.src_dir),
|
|
@@ -162,7 +162,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
162
162
|
|
|
163
163
|
ansible_runner = AnsibleProvisioner(working_dir=deploy_compose_path)
|
|
164
164
|
ansible_runner.copy_template(
|
|
165
|
-
"docker_compose_deploy",
|
|
165
|
+
"docker_compose_deploy", environment.cloud_provider_instance.name().lower()
|
|
166
166
|
)
|
|
167
167
|
|
|
168
168
|
traefik_template = self.docker_compose_snippets_env.get_template("traefik.yml")
|
|
@@ -634,7 +634,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
634
634
|
s for s in deployment_config.services if s.service_type != ServiceTypeEnum.FRONTEND
|
|
635
635
|
]
|
|
636
636
|
|
|
637
|
-
cloud_provider =
|
|
637
|
+
cloud_provider = environment.cloud_provider_instance
|
|
638
638
|
env_state_path = self._get_env_state_path(environment.name)
|
|
639
639
|
|
|
640
640
|
env_state = MonolithicDeploymentState()
|
|
@@ -761,7 +761,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
761
761
|
"""Deploys the application."""
|
|
762
762
|
env_state_path = self._get_env_state_path(environment.name)
|
|
763
763
|
env_state = MonolithicDeploymentState.load(env_state_path)
|
|
764
|
-
cloud_provider =
|
|
764
|
+
cloud_provider = environment.cloud_provider_instance
|
|
765
765
|
state_updated = False
|
|
766
766
|
|
|
767
767
|
# Release frontend services
|
|
@@ -839,7 +839,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
839
839
|
):
|
|
840
840
|
"""Destroys the environment's infrastructure."""
|
|
841
841
|
print("\n[bold blue]Destroying monolithic environment...[/bold blue]")
|
|
842
|
-
cloud_provider =
|
|
842
|
+
cloud_provider = environment.cloud_provider_instance
|
|
843
843
|
|
|
844
844
|
env_state_path = self._get_env_state_path(environment.name)
|
|
845
845
|
if not env_state_path.exists():
|
|
@@ -960,7 +960,7 @@ class MonolithicDeploymentStrategy(BaseDeploymentStrategy):
|
|
|
960
960
|
self.deployments_path
|
|
961
961
|
/ "environments"
|
|
962
962
|
/ "global"
|
|
963
|
-
/ environment.region
|
|
963
|
+
/ f"{cloud_provider.name()}-{environment.region}"
|
|
964
964
|
/ "container_registry"
|
|
965
965
|
)
|
|
966
966
|
|
|
@@ -243,39 +243,9 @@ def setup(ctx: typer.Context):
|
|
|
243
243
|
raise typer.Exit(code=1)
|
|
244
244
|
app_name = app_name_answers["app_name"]
|
|
245
245
|
|
|
246
|
-
provider_questions = [
|
|
247
|
-
inquirer.List(
|
|
248
|
-
"cloud_provider",
|
|
249
|
-
message="Select the cloud provider for deployment",
|
|
250
|
-
choices=CLOUD_PROVIDER_REGISTRY.choices,
|
|
251
|
-
),
|
|
252
|
-
]
|
|
253
|
-
provider_answers = inquirer.prompt(provider_questions)
|
|
254
|
-
if not provider_answers:
|
|
255
|
-
print("[bold red]Cloud provider selection is required. Aborting.[/bold red]")
|
|
256
|
-
raise typer.Exit(code=1)
|
|
257
|
-
|
|
258
|
-
selected_provider_value = provider_answers["cloud_provider"]
|
|
259
|
-
|
|
260
|
-
# Get cloud details if new or changed
|
|
261
|
-
print(f"Initializing {selected_provider_value} provider...\n")
|
|
262
|
-
provider_class = CLOUD_PROVIDER_REGISTRY.get_provider_class(selected_provider_value)
|
|
263
|
-
try:
|
|
264
|
-
cloud_details = provider_class.get_account_details().model_dump(mode="json")
|
|
265
|
-
except CloudCredentialsError as e:
|
|
266
|
-
print(f"[bold red]Cloud provider authentication/configuration error:\n{e}[/bold red]")
|
|
267
|
-
raise typer.Exit(code=1)
|
|
268
|
-
except Exception as e:
|
|
269
|
-
print(
|
|
270
|
-
"[bold red]An unexpected error occurred while initializing cloud provider or"
|
|
271
|
-
f" fetching details: {e}. Aborting.[/bold red]"
|
|
272
|
-
)
|
|
273
|
-
raise typer.Exit(code=1)
|
|
274
|
-
|
|
275
246
|
deployment_config = DeploymentConfig(
|
|
276
247
|
app_name=app_name,
|
|
277
248
|
app_name_slug=slugify(app_name),
|
|
278
|
-
cloud_provider=cloud_details,
|
|
279
249
|
)
|
|
280
250
|
scan_services = True
|
|
281
251
|
git_repo.ensure_gitignore()
|
|
@@ -369,10 +339,39 @@ def deploy(ctx: typer.Context):
|
|
|
369
339
|
selected_env_name = answers["environment"]
|
|
370
340
|
|
|
371
341
|
if selected_env_name == "<Create a new environment>":
|
|
342
|
+
provider_questions = [
|
|
343
|
+
inquirer.List(
|
|
344
|
+
"cloud_provider",
|
|
345
|
+
message="Select the cloud provider for deployment",
|
|
346
|
+
choices=CLOUD_PROVIDER_REGISTRY.choices,
|
|
347
|
+
),
|
|
348
|
+
]
|
|
349
|
+
provider_answers = inquirer.prompt(provider_questions)
|
|
350
|
+
if not provider_answers:
|
|
351
|
+
print("[bold red]Cloud provider selection is required. Aborting.[/bold red]")
|
|
352
|
+
raise typer.Exit(code=1)
|
|
353
|
+
|
|
354
|
+
selected_provider_value = provider_answers["cloud_provider"]
|
|
355
|
+
|
|
356
|
+
# Initialize the provider
|
|
357
|
+
print(f"Initializing {selected_provider_value} provider...\n")
|
|
358
|
+
provider_class = CLOUD_PROVIDER_REGISTRY.get_provider_class(selected_provider_value)
|
|
359
|
+
try:
|
|
360
|
+
cloud_details = provider_class.get_account_details().model_dump(mode="json")
|
|
361
|
+
except CloudCredentialsError as e:
|
|
362
|
+
print(f"[bold red]Cloud provider authentication/configuration error:\n{e}[/bold red]")
|
|
363
|
+
raise typer.Exit(code=1)
|
|
364
|
+
except Exception as e:
|
|
365
|
+
print(
|
|
366
|
+
"[bold red]An unexpected error occurred while initializing cloud provider or"
|
|
367
|
+
f" fetching details: {e}. Aborting.[/bold red]"
|
|
368
|
+
)
|
|
369
|
+
raise typer.Exit(code=1)
|
|
370
|
+
|
|
372
371
|
# Get cloud provider to fetch regions
|
|
373
372
|
with WaitingSpinner(text="Fetching regions from your cloud provider"):
|
|
374
373
|
try:
|
|
375
|
-
provider_instance =
|
|
374
|
+
provider_instance = provider_class(cloud_details)
|
|
376
375
|
regions = provider_instance.get_regions()
|
|
377
376
|
except CloudCredentialsError as e:
|
|
378
377
|
print(
|
|
@@ -466,6 +465,7 @@ def deploy(ctx: typer.Context):
|
|
|
466
465
|
|
|
467
466
|
new_env = DeploymentEnvironment(
|
|
468
467
|
name=selected_env_name,
|
|
468
|
+
cloud_provider=cloud_details,
|
|
469
469
|
region=selected_region,
|
|
470
470
|
strategy=selected_strategy,
|
|
471
471
|
domains=domains,
|
|
Binary file
|