aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
author2xsaiko2022-12-29 16:19:59 +0100
committerGitHub2022-12-29 19:19:59 +0400
commita5619f5660a00f58c2b7c16d89058e92327ac9b8 (patch)
tree41b256c1a2184c1020c7c995e00f26724d3f7452 /src/cli.rs
parent351352374c452de0378d6c22baf1745f02ae6c52 (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 'src/cli.rs')
-rw-r--r--src/cli.rs33
1 files changed, 21 insertions, 12 deletions
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![];