File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
packages/@apphosting/common/src Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -30,19 +30,27 @@ export async function runBuild(opts: BuildOptions = getBuildOptions()): Promise<
3030 shell : true ,
3131 stdio : [ "inherit" , "pipe" , "pipe" ] ,
3232 } ) ;
33- let buildOutput = "" ;
33+ let stdout = "" ;
34+ let stderr = "" ;
3435
3536 child . stdout . on ( "data" , ( data : Buffer ) => {
36- buildOutput += data . toString ( ) ;
37+ stdout += data . toString ( ) ;
3738 } ) ;
39+
40+ child . stderr . on ( "data" , ( data : Buffer ) => {
41+ stderr += data . toString ( ) ;
42+ } ) ;
43+
44+ // Re-connect the child process's stdout and stderr to the console so that
45+ // build messages and errors are still logged in Cloud Build.
46+ child . stdout . pipe ( process . stdout ) ;
47+ child . stderr . pipe ( process . stderr ) ;
48+
3849 child . on ( "exit" , ( code ) => {
3950 if ( code !== 0 ) {
40- reject ( new Error ( `Process exited with error code ${ code } . Output: ${ buildOutput } ` ) ) ;
41- }
42- if ( ! buildOutput ) {
43- reject ( new Error ( "Unable to locate build manifest with output paths." ) ) ;
51+ reject ( new Error ( `Build process exited with error code ${ code } .` ) ) ;
4452 }
45- resolve ( { stdout : buildOutput } ) ;
53+ resolve ( { stdout : stdout , stderr : stderr } ) ;
4654 } ) ;
4755 } ) ;
4856}
You can’t perform that action at this time.
0 commit comments