From 7d1b542963a94b745a47b60c1d6273a7edada565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Val=C3=AD=C4=8Dek?= Date: Wed, 10 Aug 2022 08:56:25 +0200 Subject: [PATCH] Try running executor with LAMINAR_REASON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Václav Valíček --- repo_cloner/process_repository_dir.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/repo_cloner/process_repository_dir.py b/repo_cloner/process_repository_dir.py index 87d639f..49a4963 100755 --- a/repo_cloner/process_repository_dir.py +++ b/repo_cloner/process_repository_dir.py @@ -42,7 +42,19 @@ def detector_executor(commit: DetectedCommit): for key, val in env.items(): arg_list.append(f"COMMIT_{key.upper()}={val}") - subprocess.run(arg_list) + reason = commit.abbrev + if commit.is_branch: + reason += f" branch: {commit.branches}" + if commit.is_tag: + reason += f" tags: {commit.tags}" + if commit.is_tag or commit.is_branch: + reason += "\n" + reason += commit.log + + env = os.environ.copy() + env['LAMINAR_REASON'] = reason + + subprocess.run(arg_list, env = env) def clone_or_fetch(base_dir: str, clone_init: bool = False, detector_init: bool = False): @@ -107,7 +119,8 @@ def main() -> int: parser.add_argument('--base-dir', help = 'path to directory containing whole cloner structure', required = True, default = None, type = str) parser.add_argument('--debug', '-d', help = "enable debug output", action = 'store_true') - parser.add_argument('--colored', help = "enable colored log output even tty() is not detected", action = "store_true") + parser.add_argument('--colored', help = "enable colored log output even tty() is not detected", + action = "store_true") args = parser.parse_args() if args.debug: log.setLevel(logging.DEBUG)