mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Pipe output for better logging
This commit is contained in:
parent
fce81d8210
commit
0d1283a0fc
1 changed files with 5 additions and 1 deletions
|
|
@ -35,10 +35,14 @@ export class DockerTestContainer {
|
|||
execSync(
|
||||
`docker build --progress=plain -t ${imageName} -f ${dockerFile} ${contextPath} ${buildArgs}`,
|
||||
{
|
||||
stdio: "inherit",
|
||||
stdio: "pipe",
|
||||
maxBuffer: 50 * 1024 * 1024, // 50MB buffer to capture verbose build logs
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
// Only print the build logs if the build fails
|
||||
if (error.stdout) console.log(error.stdout.toString());
|
||||
if (error.stderr) console.error(error.stderr.toString());
|
||||
throw new Error(`Failed to build Docker image: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue