@@ -264,6 +264,49 @@ export = {
264
264
test . done ( ) ;
265
265
} ,
266
266
267
+ async 'passes the correct file to docker build' ( test : Test ) {
268
+ // GIVEN
269
+ const toolkit = new ToolkitInfo ( {
270
+ sdk : new MockSDK ( ) ,
271
+ bucketName : 'BUCKET_NAME' ,
272
+ bucketEndpoint : 'BUCKET_ENDPOINT' ,
273
+ environment : { name : 'env' , account : '1234' , region : 'abc' }
274
+ } ) ;
275
+
276
+ const prepareEcrRepositoryStub = sinon . stub ( toolkit , 'prepareEcrRepository' ) . resolves ( {
277
+ repositoryUri : 'uri' ,
278
+ repositoryName : 'name'
279
+ } ) ;
280
+
281
+ const shellStub = sinon . stub ( os , 'shell' ) . rejects ( 'STOPTEST' ) ;
282
+
283
+ // WHEN
284
+ const asset : cxapi . ContainerImageAssetMetadataEntry = {
285
+ id : 'assetId' ,
286
+ imageNameParameter : 'MyParameter' ,
287
+ packaging : 'container-image' ,
288
+ path : '/foo' ,
289
+ sourceHash : '1234567890abcdef' ,
290
+ repositoryName : 'some-name' ,
291
+ file : 'some-file'
292
+ } ;
293
+
294
+ try {
295
+ await prepareContainerAsset ( '.' , asset , toolkit , false ) ;
296
+ } catch ( e ) {
297
+ if ( ! / S T O P T E S T / . test ( e . toString ( ) ) ) { throw e ; }
298
+ }
299
+
300
+ // THEN
301
+ const command = [ 'docker' , 'build' , '--tag' , `uri:latest` , '/foo' , '--file' , 'some-file' ] ;
302
+
303
+ test . ok ( shellStub . calledWith ( command ) ) ;
304
+
305
+ prepareEcrRepositoryStub . restore ( ) ;
306
+ shellStub . restore ( ) ;
307
+ test . done ( ) ;
308
+ } ,
309
+
267
310
async 'relative path' ( test : Test ) {
268
311
// GIVEN
269
312
const toolkit = new ToolkitInfo ( {
0 commit comments