File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
packages/cli-v3/src/commands Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -688,7 +688,10 @@ async function buildAndPushImage(
688
688
childProcess . stderr ?. on ( "data" , ( data : Buffer ) => {
689
689
const text = data . toString ( ) ;
690
690
691
- errors . push ( text ) ;
691
+ // Emitted data chunks can contain multiple lines. Remove empty lines.
692
+ const lines = text . split ( "\n" ) . filter ( Boolean ) ;
693
+
694
+ errors . push ( ...lines ) ;
692
695
logger . debug ( text ) ;
693
696
} ) ;
694
697
@@ -896,14 +899,15 @@ async function buildAndPushSelfHostedImage(
896
899
}
897
900
898
901
function extractImageDigest ( outputs : string [ ] ) {
899
- const imageDigestRegex = / s h a 2 5 6 : [ a - f 0 - 9 ] { 64 } / ;
902
+ const imageDigestRegex = / p u s h i n g m a n i f e s t f o r . + (?< digest > s h a 2 5 6 : [ a - f 0 - 9 ] { 64 } ) / ;
900
903
901
904
for ( const line of outputs ) {
902
- if ( line . includes ( "pushing manifest" ) ) {
903
- const imageDigestMatch = line . match ( imageDigestRegex ) ;
904
- if ( imageDigestMatch ) {
905
- return imageDigestMatch [ 0 ] ;
906
- }
905
+ const imageDigestMatch = line . match ( imageDigestRegex ) ;
906
+
907
+ const digest = imageDigestMatch ?. groups ?. digest ;
908
+
909
+ if ( digest ) {
910
+ return digest ;
907
911
}
908
912
}
909
913
}
You can’t perform that action at this time.
0 commit comments