@@ -11,7 +11,7 @@ const prep = require('./prep');
1111const builderName = 'dev-containers-builder' ;
1212
1313async function push ( repo , release , updateLatest , registry , registryPath , stubRegistry ,
14- stubRegistryPath , pushImages , prepOnly , definitionsToSkip , page , pageTotal , replaceImages , definitionId ) {
14+ stubRegistryPath , pushImages , prepOnly , definitionsToSkip , page , pageTotal , replaceImages , definitionId , secondaryRegistryPath ) {
1515
1616 // Optional argument defaults
1717 prepOnly = typeof prepOnly === 'undefined' ? false : prepOnly ;
@@ -45,14 +45,14 @@ async function push(repo, release, updateLatest, registry, registryPath, stubReg
4545 await asyncUtils . forEach ( definitionsToPush , async ( currentDefinitionId ) => {
4646 console . log ( `**** Pushing ${ currentDefinitionId } ${ release } ****` ) ;
4747 await pushImage (
48- currentDefinitionId , repo , release , updateLatest , registry , registryPath , stubRegistry , stubRegistryPath , prepOnly , pushImages , replaceImages ) ;
48+ currentDefinitionId , repo , release , updateLatest , registry , registryPath , stubRegistry , stubRegistryPath , prepOnly , pushImages , replaceImages , secondaryRegistryPath ) ;
4949 } ) ;
5050
5151 return stagingFolder ;
5252}
5353
5454async function pushImage ( definitionId , repo , release , updateLatest ,
55- registry , registryPath , stubRegistry , stubRegistryPath , prepOnly , pushImages , replaceImage ) {
55+ registry , registryPath , stubRegistry , stubRegistryPath , prepOnly , pushImages , replaceImage , secondaryRegistryPath ) {
5656 const definitionPath = configUtils . getDefinitionPath ( definitionId ) ;
5757 const dotDevContainerPath = definitionPath ;
5858 // Use Dockerfile for image build
@@ -93,7 +93,12 @@ async function pushImage(definitionId, repo, release, updateLatest,
9393 const imageNamesWithVersionTags = configUtils . getTagList ( definitionId , release , updateLatest , registry , registryPath , variant ) ;
9494 const imageName = imageNamesWithVersionTags [ 0 ] . split ( ':' ) [ 0 ] ;
9595
96+ // Dual publish image to devcontainers and vscode/devcontainers
97+ const secondaryImageNamesWithVersionTags = configUtils . getTagList ( definitionId , release , updateLatest , registry , secondaryRegistryPath , variant ) ;
98+
9699 console . log ( `(*) Tags:${ imageNamesWithVersionTags . reduce ( ( prev , current ) => prev += `\n ${ current } ` , '' ) } ` ) ;
100+ console . log ( `(*) Secondary Tags:${ secondaryImageNamesWithVersionTags . reduce ( ( prev , current ) => prev += `\n ${ current } ` , '' ) } ` ) ;
101+
97102 const buildSettings = configUtils . getBuildSettings ( definitionId ) ;
98103
99104 let architectures = buildSettings . architectures ;
@@ -130,7 +135,10 @@ async function pushImage(definitionId, repo, release, updateLatest,
130135
131136 const context = devContainerJson . build ? devContainerJson . build . context || '.' : devContainerJson . context || '.' ;
132137 const workingDir = path . resolve ( dotDevContainerPath , context ) ;
133- const imageNameParams = imageNamesWithVersionTags . reduce ( ( prev , current ) => prev . concat ( [ '--image-name' , current ] ) , [ ] ) ;
138+ let imageNameParams = imageNamesWithVersionTags . reduce ( ( prev , current ) => prev . concat ( [ '--image-name' , current ] ) , [ ] ) ;
139+
140+ const secondaryImageNameParams = secondaryImageNamesWithVersionTags . reduce ( ( prev , current ) => prev . concat ( [ '--image-name' , current ] ) , [ ] ) ;
141+ imageNameParams = imageNameParams . concat ( secondaryImageNameParams ) ;
134142
135143 const spawnOpts = { stdio : 'inherit' , cwd : workingDir , shell : true } ;
136144 await asyncUtils . spawn ( 'devcontainer' , [
0 commit comments