@@ -8,7 +8,7 @@ use std::io::{stdin, stdout, Write};
8
8
9
9
use clap:: { ArgMatches , Clap , FromArgMatches } ;
10
10
use futures_util:: future:: { join_all, try_join_all} ;
11
- use tokio:: try_join;
11
+ use tokio:: { try_join, join } ;
12
12
13
13
use crate as deploy;
14
14
use crate :: push:: { PushProfileData , PushProfileError } ;
@@ -600,9 +600,9 @@ async fn run_deploy(
600
600
}
601
601
} ) ;
602
602
603
- try_join ! (
603
+ let remote_results = join ! (
604
604
// remote builds can be run asynchronously (per host)
605
- try_join_all ( remote_build_map. into_iter( ) . map( deploy_profiles_to_host) ) ,
605
+ join_all ( remote_build_map. into_iter( ) . map( deploy_profiles_to_host) ) ,
606
606
async {
607
607
// run local builds synchronously to prevent hardware deadlocks
608
608
for data in & local_builds {
@@ -614,11 +614,18 @@ async fn run_deploy(
614
614
let data = data;
615
615
deploy:: push:: push_profile( & data) . await
616
616
} ) ) . await ;
617
-
618
- Ok ( ( ) )
619
617
}
620
- ) ? ;
618
+ ) . 0 ;
621
619
620
+ for result in remote_results {
621
+ match result {
622
+ Err ( ( host, profile, e) ) => {
623
+ error ! ( "failed building profile {} on host {}: {:?}" , profile, host, e) ;
624
+ return Err ( RunDeployError :: PushProfile ( e) ) ;
625
+ } ,
626
+ _ => ( ) ,
627
+ }
628
+ }
622
629
623
630
let mut succeeded: Vec < ( & deploy:: DeployData , & deploy:: DeployDefs ) > = vec ! [ ] ;
624
631
@@ -750,9 +757,9 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
750
757
Ok ( ( ) )
751
758
}
752
759
753
- async fn deploy_profiles_to_host < ' a > ( ( _host , profiles) : ( & str , Vec < & ' a PushProfileData < ' a > > ) ) -> Result < ( ) , PushProfileError > {
760
+ async fn deploy_profiles_to_host < ' a > ( ( host , profiles) : ( & str , Vec < & ' a PushProfileData < ' a > > ) ) -> Result < ( ) , ( String , String , PushProfileError ) > {
754
761
for profile in & profiles {
755
- deploy:: push:: build_profile ( profile) . await ?;
762
+ deploy:: push:: build_profile ( profile) . await . map_err ( |e| ( host . to_string ( ) , profile . deploy_data . profile_name . to_string ( ) , e ) ) ?;
756
763
} ;
757
764
Ok ( ( ) )
758
765
}
0 commit comments