diff --git a/forge-server/src/main.rs b/forge-server/src/main.rs index 21a0f5d..95ecd8d 100644 --- a/forge-server/src/main.rs +++ b/forge-server/src/main.rs @@ -135,33 +135,36 @@ async fn build(msg: Message, address: SocketAddr, dir: PathBuf) { .output() .unwrap(); if !git_output.status.success() { - error!("{:?}", git_output); - } else { - info!("{:?}", git_output); + warn!( + "Git clone failed for repository {}", + &msg.repository + ); } - let build_output = match msg.command.tag { - Tag::Release => { - pCommand::new(msg.command.build_system.to_string()) + tokio::spawn(async move { + let build_output = match msg.command.tag { + Tag::Release => { + pCommand::new(msg.command.build_system.to_string()) + .arg(msg.command.subcommand.to_string()) + .arg(msg.command.tag.to_string()) + .arg(format!("--manifest-path={}", &manifest.display())) + // .arg(features.to_string()) + .output() + .unwrap() + } + Tag::Debug => pCommand::new(msg.command.build_system.to_string()) .arg(msg.command.subcommand.to_string()) - .arg(msg.command.tag.to_string()) .arg(format!("--manifest-path={}", &manifest.display())) - // .arg(features.to_string()) .output() - .unwrap() - } - Tag::Debug => pCommand::new(msg.command.build_system.to_string()) - .arg(msg.command.subcommand.to_string()) - .arg(format!("--manifest-path={}", &manifest.display())) - .output() - .unwrap(), - }; + .unwrap(), + }; - if !build_output.status.success() { - error!("{:?}", build_output); - } else { - info!("{:?}", build_output); - } + if !build_output.status.success() { + warn!("Build {} failed!", &msg.uuid); + } else { + success!("Build {} finished!", &msg.uuid); + } + }); match msg.pre_exec { Some(e) => info!("Running pre-exec: {}", e),