diff options
author | Lars Wirzenius <liw@liw.fi> | 2024-01-16 19:53:34 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2024-01-16 19:53:34 +0200 |
commit | 294db7449d342ca0ccd7ff685f98892c5da230ec (patch) | |
tree | a877239c686f616d3a43607858b5915f6c257208 | |
parent | decc8e979cafdfba1b26ba2625839fe3b2fbe575 (diff) | |
download | radicle-native-ci-294db7449d342ca0ccd7ff685f98892c5da230ec.tar.gz |
fix: set run log filename
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rw-r--r-- | src/engine.rs | 7 | ||||
-rw-r--r-- | src/run.rs | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/engine.rs b/src/engine.rs index 96f61dd..cee51ac 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -66,6 +66,8 @@ impl Engine { let mut success = false; match req { Request::Trigger { repo, commit } => { + self.run_info_builder.repo(repo); + self.run_info_builder.commit(commit); match self.run_helper(repo, commit) { Ok(true) => success = true, Ok(false) => (), @@ -146,6 +148,9 @@ impl Engine { // Set the file where the run info should be written, now that // we have the run directory. + let run_log_filename = run_dir.join("log.html"); + self.run_info_builder + .log(&self.config.state, run_log_filename.clone()); self.run_info_builder.run_info(run_dir.join("run.yaml")); // Get node git storage. We do this before responding to the @@ -158,7 +163,7 @@ impl Engine { write_triggered(&run_id)?; // Create and set up the run. - let mut run = Run::new(&run_dir, run_id)?; + let mut run = Run::new(&run_dir, &run_log_filename)?; run.set_repository(rid); run.set_commit(commit); run.set_storage(storage); @@ -3,7 +3,7 @@ use std::{ process::Command, }; -use radicle_ci_broker::msg::{Id, Oid, RunId}; +use radicle_ci_broker::msg::{Id, Oid}; use crate::{ msg::NativeMessageError, @@ -38,9 +38,8 @@ pub struct Run { impl Run { /// Create a new `Run`. - pub fn new(run_dir: &Path, run_id: RunId) -> Result<Self, RunError> { - let run_log_filename = run_dir.join("log.html"); - let run_log = RunLog::new(&run_log_filename); + pub fn new(run_dir: &Path, run_log_filename: &Path) -> Result<Self, RunError> { + let run_log = RunLog::new(run_log_filename); Ok(Self { run_log, |