diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index d9b95a5..28d51dc 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@shipzone/npmci', - version: '4.1.1', + version: '4.1.2', description: 'node and docker in gitlab ci on steroids' } diff --git a/ts/manager.docker/mod.classes.dockerfile.ts b/ts/manager.docker/mod.classes.dockerfile.ts index d07c33e..cf20865 100644 --- a/ts/manager.docker/mod.classes.dockerfile.ts +++ b/ts/manager.docker/mod.classes.dockerfile.ts @@ -177,14 +177,14 @@ export class Dockerfile { ): Promise { logger.log('info', 'checking for env vars to be supplied to the docker build'); let buildArgsString: string = ''; - for (const key of Object.keys( + for (const dockerArgKey of Object.keys( npmciDockerManagerRef.npmciRef.npmciConfig.getConfig().dockerBuildargEnvMap )) { - const targetValue = - process.env[ - npmciDockerManagerRef.npmciRef.npmciConfig.getConfig().dockerBuildargEnvMap[key] - ]; - buildArgsString = `${buildArgsString} --build-arg ${key}="${targetValue}"`; + const dockerArgOuterEnvVar = + npmciDockerManagerRef.npmciRef.npmciConfig.getConfig().dockerBuildargEnvMap[dockerArgKey]; + logger.log('note', `docker ARG "${dockerArgKey}" maps to outer env var "${dockerArgOuterEnvVar}"`); + const targetValue = process.env[dockerArgOuterEnvVar]; + buildArgsString = `${buildArgsString} --build-arg ${dockerArgKey}="${targetValue}"`; } return buildArgsString; }