@@ -3,7 +3,7 @@ import { DockerImageDestination } from '@aws-cdk/cloud-assembly-schema';
33import type * as AWS from 'aws-sdk' ;
44import { DockerImageManifestEntry } from '../../asset-manifest' ;
55import { EventType } from '../../progress' ;
6- import { IAssetHandler , IHandlerHost } from '../asset-handler' ;
6+ import { IAssetHandler , IHandlerHost , IHandlerOptions } from '../asset-handler' ;
77import { Docker } from '../docker' ;
88import { replaceAwsPlaceholders } from '../placeholders' ;
99import { shell } from '../shell' ;
@@ -21,7 +21,8 @@ export class ContainerImageAssetHandler implements IAssetHandler {
2121 constructor (
2222 private readonly workDir : string ,
2323 private readonly asset : DockerImageManifestEntry ,
24- private readonly host : IHandlerHost ) {
24+ private readonly host : IHandlerHost ,
25+ private readonly options : IHandlerOptions ) {
2526 }
2627
2728 public async build ( ) : Promise < void > {
@@ -36,7 +37,9 @@ export class ContainerImageAssetHandler implements IAssetHandler {
3637 ecr : initOnce . ecr ,
3738 } ) ;
3839
39- const builder = new ContainerImageBuilder ( dockerForBuilding , this . workDir , this . asset , this . host ) ;
40+ const builder = new ContainerImageBuilder ( dockerForBuilding , this . workDir , this . asset , this . host , {
41+ quiet : this . options . quiet ,
42+ } ) ;
4043 const localTagName = await builder . build ( ) ;
4144
4245 if ( localTagName === undefined || this . host . aborted ) { return ; }
@@ -70,7 +73,7 @@ export class ContainerImageAssetHandler implements IAssetHandler {
7073 if ( this . host . aborted ) { return ; }
7174
7275 this . host . emitMessage ( EventType . UPLOAD , `Push ${ initOnce . imageUri } ` ) ;
73- await dockerForPushing . push ( initOnce . imageUri ) ;
76+ await dockerForPushing . push ( { tag : initOnce . imageUri , quite : this . options . quiet } ) ;
7477 }
7578
7679 private async initOnce ( options : { quiet ?: boolean } = { } ) : Promise < ContainerImageAssetHandlerInit > {
@@ -120,12 +123,17 @@ export class ContainerImageAssetHandler implements IAssetHandler {
120123 }
121124}
122125
126+ interface ContainerImageBuilderOptions {
127+ readonly quiet ?: boolean ;
128+ }
129+
123130class ContainerImageBuilder {
124131 constructor (
125132 private readonly docker : Docker ,
126133 private readonly workDir : string ,
127134 private readonly asset : DockerImageManifestEntry ,
128- private readonly host : IHandlerHost ) {
135+ private readonly host : IHandlerHost ,
136+ private readonly options : ContainerImageBuilderOptions ) {
129137 }
130138
131139 async build ( ) : Promise < string | undefined > {
@@ -188,6 +196,7 @@ class ContainerImageBuilder {
188196 outputs : source . dockerOutputs ,
189197 cacheFrom : source . cacheFrom ,
190198 cacheTo : source . cacheTo ,
199+ quiet : this . options . quiet ,
191200 } ) ;
192201 }
193202
0 commit comments