From a5619f5660a00f58c2b7c16d89058e92327ac9b8 Mon Sep 17 00:00:00 2001 From: 2xsaiko Date: Thu, 29 Dec 2022 16:19:59 +0100 Subject: Build every profile first, then push (#158) Try to build everything first before pushing to remotes. Since the build is more likely to fail than the upload, if there is an error the deployment will fail sooner and before uploading any potentially unusable configuration.--- src/cli.rs | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index ab9499a..f259563 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -545,18 +545,27 @@ async fn run_deploy( print_deployment(&parts[..])?; } - for (deploy_flake, deploy_data, deploy_defs) in &parts { - deploy::push::push_profile(deploy::push::PushProfileData { - supports_flakes, - check_sigs, - repo: deploy_flake.repo, - deploy_data, - deploy_defs, - keep_result, - result_path, - extra_build_args, - }) - .await?; + let data_iter = || { + parts.iter().map( + |(deploy_flake, deploy_data, deploy_defs)| deploy::push::PushProfileData { + supports_flakes, + check_sigs, + repo: deploy_flake.repo, + deploy_data, + deploy_defs, + keep_result, + result_path, + extra_build_args, + }, + ) + }; + + for data in data_iter() { + deploy::push::build_profile(data).await?; + } + + for data in data_iter() { + deploy::push::push_profile(data).await?; } let mut succeeded: Vec<(&deploy::DeployData, &deploy::DeployDefs)> = vec![]; -- cgit v1.2.3