diff --git a/dozer-cli/src/cloud/deployer.rs b/dozer-cli/src/cloud/deployer.rs index f4b661dd18..f250950045 100644 --- a/dozer-cli/src/cloud/deployer.rs +++ b/dozer-cli/src/cloud/deployer.rs @@ -34,10 +34,11 @@ pub async fn deploy_app( let deployment_id = response.deployment_id; let url = response.deployment_url; info!("Deploying new application with App Id: {app_id}, Deployment Id: {deployment_id}"); - info!("Follow the deployment progress at {url}"); - + CloudAppContext::save_app_id(app_id.clone())?; if follow { print_progress(client, app_id, deployment_id).await?; + } else { + info!("Follow the deployment progress at {url}"); } Ok::<(), CloudError>(()) @@ -63,12 +64,11 @@ async fn print_progress( if response.status == DeploymentStatus::Success as i32 { info!("Deployment completed successfully"); info!("You can get API requests samples with `dozer cloud api-request-samples`"); - - CloudAppContext::save_app_id(app_id)?; - break; } else if response.status == DeploymentStatus::Failed as i32 { warn!("Deployment failed!"); + info!("Cleaning up..."); + CloudAppContext::delete_config_file()?; break; } else { let steps = response.steps.clone(); diff --git a/dozer-cli/src/main.rs b/dozer-cli/src/main.rs index a3ea2b85af..8afc1cc1ef 100644 --- a/dozer-cli/src/main.rs +++ b/dozer-cli/src/main.rs @@ -148,7 +148,7 @@ fn run() -> Result<(), OrchestrationError> { config_res .as_ref() .map(|c| c.telemetry.clone()) - .unwrap_or(TelemetryConfig::default()) + .unwrap_or_default() }; let _telemetry = runtime.block_on(async { Telemetry::new(app_id, &telemetry_config) }); @@ -230,6 +230,7 @@ fn run() -> Result<(), OrchestrationError> { }) } +#[cfg(feature = "cloud")] fn run_cloud( cloud: &dozer_cli::cli::cloud::Cloud, runtime: Arc,