From ccf323bb0812638ca551f88e0adc71e166ea979f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 31 May 2021 11:55:48 +0200 Subject: Fix: git commit hash/author information passing This fixes the git commit hash and author information passing. The changes in 2d72cbed2495517dba84ec4d46e5f521ff46412b did not add the environment variables to the `find_artifact()` call when searching for replacement artifacts. Thus, calling the same build twice, with the staging directory from the first call added in the second call, resulted in a full rebuild, although the artifacts from the first call could be resused. With this patch applied, this issue is fixed by adding the environment variables to the environment passed to the `find_artifacts()` call. Fixes: 2d72cbed2495517dba84ec4d46e5f521ff46412b ("Add feature to pass git author and git commit information to container") Signed-off-by: Matthias Beyer Tested-by: Matthias Beyer --- src/orchestrator/orchestrator.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/orchestrator/orchestrator.rs') diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index b118ed1..dd1322d 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -571,6 +571,8 @@ impl<'a> JobTask<'a> { .iter() .filter_map(crate::job::JobResource::env) .map(|(k, v)| (k.clone(), v.clone())) + .chain(self.git_author_env.cloned().into_iter()) + .chain(self.git_commit_env.cloned().into_iter()) .collect::>(); let replacement_artifacts = crate::db::find_artifacts( -- cgit v1.2.3