From 07f1dadea265d6fc74b0a25f1f3451ec67fcf854 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Sat, 28 Nov 2020 14:38:26 -0800 Subject: [PATCH] Ensure the agent exits with the right status to propagate failures up Fixes #51 --- cli/agent/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/agent/src/main.rs b/cli/agent/src/main.rs index b2ac2ad..f2ec8c1 100644 --- a/cli/agent/src/main.rs +++ b/cli/agent/src/main.rs @@ -93,9 +93,12 @@ async fn main() -> std::io::Result<()> { set_common_env_vars(); - run(&steps_dir, &invoke.steps, invoke.pipeline, Some(receiver)) + let status = run(&steps_dir, &invoke.steps, invoke.pipeline, Some(receiver)) .expect("Failed to run pipeline"); + + println!("Agent exiting {:?}", status); + + std::process::exit(status as i32); } }; - Ok(()) }