From df629c8b833567fabfb34574c15ea787415d859c Mon Sep 17 00:00:00 2001 From: VG Date: Sun, 8 Oct 2023 17:57:34 +0800 Subject: [PATCH] chore: store and clean up --- dozer-cli/src/cloud/deployer.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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();