now has working dockerBuildArgEnvMap

This commit is contained in:
Philipp Kunz 2017-08-29 06:07:13 +02:00
parent 37b3c1abc9
commit c247cc2892
8 changed files with 16 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ import { KeyValueStore } from 'npmextra';
export interface INpmciOptions {
npmGlobalTools: string[];
dockerRegistryRepoMap: any;
dockerEnvBuildargMap: any;
dockerBuildargEnvMap: any;
}
export declare let kvStorage: KeyValueStore;
export declare let configObject: INpmciOptions;

View File

@ -19,7 +19,7 @@ let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
let defaultConfig = {
npmGlobalTools: [],
dockerRegistryRepoMap: {},
dockerEnvBuildargMap: {}
dockerBuildargEnvMap: {}
};
exports.configObject = npmciNpmextra.dataFor('npmci', defaultConfig);
exports.getConfig = () => __awaiter(this, void 0, void 0, function* () {

View File

@ -1,3 +1,4 @@
import 'typings-global';
export import beautylog = require('beautylog');
export declare let gulp: any;
export import gulpFunction = require('gulp-function');

View File

@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
exports.beautylog = require("beautylog");
exports.gulp = require('gulp');
exports.gulpFunction = require("gulp-function");
@ -22,4 +23,4 @@ exports.smartsystem = require("smartsystem");
exports.smartssh = require("smartssh");
exports.smartstring = require("smartstring");
exports.through2 = require("through2");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5Q0FBOEM7QUFDbkMsUUFBQSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFBO0FBQ2pDLGdEQUFxRDtBQUNyRCxtQ0FBd0M7QUFDeEMsdUNBQTRDO0FBQzVDLCtCQUFvQztBQU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Arg: string, repoArg: string, versionAr
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
for (let key in NpmciConfig.configObject.dockerBuildargEnvMap) {
let targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]]
buildArgsString = `${buildArgsString} --build-arg ${key}=${targetValue}`
}
return buildArgsString
}
}
/**
*

View File

@ -10,7 +10,7 @@ import { KeyValueStore } from 'npmextra'
export interface INpmciOptions {
npmGlobalTools: string[]
dockerRegistryRepoMap: any
dockerEnvBuildargMap: any
dockerBuildargEnvMap: any
}
// instantiate a kvStorage for the current directory
@ -21,7 +21,7 @@ let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
let defaultConfig: INpmciOptions = {
npmGlobalTools: [],
dockerRegistryRepoMap: {},
dockerEnvBuildargMap: {}
dockerBuildargEnvMap: {}
}
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig)

View File

@ -1,3 +1,4 @@
import 'typings-global'
export import beautylog = require('beautylog')
export let gulp = require('gulp')
export import gulpFunction = require('gulp-function')