start build args implementation
This commit is contained in:
@ -40,7 +40,8 @@ export class Dockerfile {
|
||||
*/
|
||||
async build () {
|
||||
plugins.beautylog.info('now building Dockerfile for ' + this.cleanTag)
|
||||
let buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} .`
|
||||
let buildArgsString = await helpers.getDockerBuildArgs()
|
||||
let buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`
|
||||
await bash(buildCommand)
|
||||
return
|
||||
}
|
||||
|
@ -153,6 +153,15 @@ export let getDockerTagString = (registryArg: string, repoArg: string, versionAr
|
||||
return tagString
|
||||
}
|
||||
|
||||
export let getDockerBuildArgs = async (): Promise<string> => {
|
||||
plugins.beautylog.info('checking for env vars to be supplied to the docker build')
|
||||
let buildArgsString: string = ''
|
||||
for (let key in NpmciConfig.configObject.dockerEnvBuildargMap) {
|
||||
// TODO
|
||||
}
|
||||
return buildArgsString
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@ import { KeyValueStore } from 'npmextra'
|
||||
export interface INpmciOptions {
|
||||
npmGlobalTools: string[]
|
||||
dockerRegistryRepoMap: any
|
||||
dockerEnvBuildargMap: any
|
||||
}
|
||||
|
||||
// instantiate a kvStorage for the current directory
|
||||
@ -19,7 +20,8 @@ export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`)
|
||||
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
|
||||
let defaultConfig: INpmciOptions = {
|
||||
npmGlobalTools: [],
|
||||
dockerRegistryRepoMap: {}
|
||||
dockerRegistryRepoMap: {},
|
||||
dockerEnvBuildargMap: {}
|
||||
}
|
||||
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig)
|
||||
|
||||
|
Reference in New Issue
Block a user