diff options
author | 2xsaiko | 2022-12-29 16:19:59 +0100 |
---|---|---|
committer | GitHub | 2022-12-29 19:19:59 +0400 |
commit | a5619f5660a00f58c2b7c16d89058e92327ac9b8 (patch) | |
tree | 41b256c1a2184c1020c7c995e00f26724d3f7452 /src/cli.rs | |
parent | 351352374c452de0378d6c22baf1745f02ae6c52 (diff) |
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.
Diffstat (limited to '')
-rw-r--r-- | src/cli.rs | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -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![]; |