From 275546b5e4ccfa675e7b49585e6b3d499c7efa98 Mon Sep 17 00:00:00 2001 From: Alexander Fougner Date: Thu, 5 Sep 2024 16:30:24 +0200 Subject: [PATCH] feat(nx-container): add verbose logging of build command and stdout in nx-container Add verbose logging of build command and stdout in nx-container. fix #1127 --- plugins/nx-container/src/executors/build/executor.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/nx-container/src/executors/build/executor.ts b/plugins/nx-container/src/executors/build/executor.ts index 997cf19a..e8f610c7 100644 --- a/plugins/nx-container/src/executors/build/executor.ts +++ b/plugins/nx-container/src/executors/build/executor.ts @@ -38,6 +38,9 @@ const runExecutor: PromiseExecutor = async (options, ctx) = const args: string[] = await engine.getArgs(inputs, defContext); const buildCmd = engine.getCommand(args); + + logger.verbose(`Build command: ${buildCmd.command} ${buildCmd.args.join(' ')}`); + await getExecOutput( buildCmd.command, buildCmd.args.map((arg) => interpolate(arg)), @@ -45,6 +48,8 @@ const runExecutor: PromiseExecutor = async (options, ctx) = ignoreReturnCode: true, } ).then((res) => { + logger.verbose(res.stdout); + if (res.stderr.length > 0 && res.exitCode != 0) { throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`); }