some cosmetics

This commit is contained in:
Philipp Kunz 2016-06-07 12:36:00 +02:00
parent cb2400652f
commit b1e873afa8
7 changed files with 49 additions and 25 deletions

21
dist/index.js vendored
View File

@ -10,6 +10,7 @@ var npmci_publish_1 = require("./npmci.publish");
var npmci_prepare_1 = require("./npmci.prepare"); var npmci_prepare_1 = require("./npmci.prepare");
var npmci_test_1 = require("./npmci.test"); var npmci_test_1 = require("./npmci.test");
var npmci_trigger_1 = require("./npmci.trigger"); var npmci_trigger_1 = require("./npmci.trigger");
var NpmciEnv = require("./npmci.env");
var command; var command;
var commandOption; var commandOption;
plugins.commander plugins.commander
@ -25,19 +26,27 @@ if (typeof command === 'undefined') {
} }
switch (command) { switch (command) {
case "build": case "build":
npmci_build_1.build(commandOption); npmci_build_1.build(commandOption)
.then(NpmciEnv.configStore);
break; break;
case "install": case "install":
npmci_install_1.install(commandOption); npmci_install_1.install(commandOption)
.then(NpmciEnv.configStore);
;
break; break;
case "prepare": case "prepare":
npmci_prepare_1.prepare(commandOption); npmci_prepare_1.prepare(commandOption)
.then(NpmciEnv.configStore);
;
break; break;
case "publish": case "publish":
npmci_publish_1.publish(commandOption); npmci_publish_1.publish(commandOption)
.then(NpmciEnv.configStore);
;
break; break;
case "test": case "test":
npmci_test_1.test(commandOption); npmci_test_1.test(commandOption)
.then(NpmciEnv.configStore);
break; break;
case "trigger": case "trigger":
npmci_trigger_1.trigger(); npmci_trigger_1.trigger();
@ -46,4 +55,4 @@ switch (command) {
break; break;
} }
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFFM0MsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7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pc2hcIjpcclxuICAgICAgICBwdWJsaXNoKGNvbW1hbmRPcHRpb24pXHJcbiAgICAgICAgICAgIC50aGVuKE5wbWNpRW52LmNvbmZpZ1N0b3JlKTs7XHJcbiAgICAgICAgYnJlYWs7XHJcbiAgICBjYXNlIFwidGVzdFwiOlxyXG4gICAgICAgIHRlc3QoY29tbWFuZE9wdGlvbilcclxuICAgICAgICAgICAgLnRoZW4oTnBtY2lFbnYuY29uZmlnU3RvcmUpO1xyXG4gICAgICAgIGJyZWFrO1xyXG4gICAgY2FzZSBcInRyaWdnZXJcIjpcclxuICAgICAgICB0cmlnZ2VyKCk7XHJcbiAgICAgICAgYnJlYWs7XHJcbiAgICBkZWZhdWx0OlxyXG4gICAgICAgIGJyZWFrO1xyXG59XHJcblxyXG4iXX0=

File diff suppressed because one or more lines are too long

1
dist/npmci.env.d.ts vendored
View File

@ -6,6 +6,5 @@ export declare let buildStage: string;
export declare let dockerRegistry: any; export declare let dockerRegistry: any;
export declare let dockerFilesBuilt: Dockerfile[]; export declare let dockerFilesBuilt: Dockerfile[];
export declare let dockerFiles: Dockerfile[]; export declare let dockerFiles: Dockerfile[];
export declare let config: any;
export declare let configStore: () => void; export declare let configStore: () => void;
export declare let configLoad: () => void; export declare let configLoad: () => void;

20
dist/npmci.env.js vendored
View File

@ -8,23 +8,29 @@ exports.buildStage = process.env.CI_BUILD_STAGE;
exports.dockerFilesBuilt = []; exports.dockerFilesBuilt = [];
exports.dockerFiles = []; exports.dockerFiles = [];
exports.configStore = function () { exports.configStore = function () {
plugins.smartfile.memory.toFsSync(JSON.stringify(exports.config), { var config = {
dockerRegistry: exports.dockerRegistry,
dockerFilesBuilt: exports.dockerFilesBuilt,
dockerFiles: exports.dockerFiles
};
plugins.smartfile.memory.toFsSync(JSON.stringify(config), {
fileName: "config.json", fileName: "config.json",
filePath: paths.NpmciPackageRoot filePath: paths.NpmciPackageRoot
}); });
}; };
exports.configLoad = function () { exports.configLoad = function () {
var config;
try { try {
exports.config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig, "json"); config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig, "json");
} }
catch (err) { catch (err) {
exports.config = {}; config = {};
exports.configStore(); exports.configStore();
plugins.beautylog.log("config inititialized!"); plugins.beautylog.log("config initialized!");
} }
exports.config.dockerRegistry ? exports.dockerRegistry = exports.config.dockerRegistry : void (0); config.dockerRegistry ? exports.dockerRegistry = config.dockerRegistry : void (0);
exports.config.dockerFilesBuilt ? exports.dockerFilesBuilt = exports.config.dockerFilesBuilt : void (0); config.dockerFilesBuilt ? exports.dockerFilesBuilt = config.dockerFilesBuilt : void (0);
}; };
exports.configLoad(); exports.configLoad();
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsNEJBQXNCLGFBQWEsQ0FBQyxDQUFBO0FBR3pCLFlBQUksR0FBVyxJQUFJLHFCQUFPLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUMsQ0FBQztBQUV0RCxrQkFBVSxHQUFVLE9BQU8sQ0FBQyxHQUFHLENBQUMsY0FBYyxDQUFDO0FBSS9DLHdCQUFnQixHQUFnQixFQUFFLENBQUM7QUFDbkMsbUJBQVcsR0FBZ0IsRUFBRSxDQUFDO0FBSTlCLG1CQUFXLEdBQUc7SUFDckIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUM3QixJQUFJLENBQUMsU0FBUyxDQUFDLGNBQU0sQ0FBQyxFQUN0QjtRQUNJLFFBQVEsRUFBQyxhQUFhO1FBQ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gICAgICAgZmlsZU5hbWU6XCJjb25maWcuanNvblwiLFxyXG4gICAgICAgICAgICBmaWxlUGF0aDpwYXRocy5OcG1jaVBhY2thZ2VSb290XHJcbiAgICAgICAgfVxyXG4gICAgKTtcclxufVxyXG5cclxuZXhwb3J0IGxldCBjb25maWdMb2FkID0gKCkgPT4ge1xyXG4gICAgbGV0IGNvbmZpZztcclxuICAgIHRyeSB7XHJcbiAgICAgICAgY29uZmlnID0gcGx1Z2lucy5zbWFydGZpbGUubG9jYWwudG9PYmplY3RTeW5jKHBhdGhzLk5wbWNpUGFja2FnZUNvbmZpZyxcImpzb25cIik7XHJcbiAgICB9XHJcbiAgICBjYXRjaChlcnIpe1xyXG4gICAgICAgIGNvbmZpZyA9IHt9O1xyXG4gICAgICAgIGNvbmZpZ1N0b3JlKCk7XHJcbiAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cubG9nKFwiY29uZmlnIGluaXRpYWxpemVkIVwiKTtcclxuICAgIH1cclxuICAgIFxyXG4gICAgY29uZmlnLmRvY2tlclJlZ2lzdHJ5ID8gZG9ja2VyUmVnaXN0cnkgPSBjb25maWcuZG9ja2VyUmVnaXN0cnkgOiB2b2lkKDApO1xyXG4gICAgY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgPyBkb2NrZXJGaWxlc0J1aWx0ID0gY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgOiB2b2lkKDApO1xyXG59XHJcbmNvbmZpZ0xvYWQoKTsiXX0=

View File

@ -13,6 +13,7 @@ import {prepare} from "./npmci.prepare";
import {tag, retag} from "./npmci.tag"; import {tag, retag} from "./npmci.tag";
import {test} from "./npmci.test"; import {test} from "./npmci.test";
import {trigger} from "./npmci.trigger"; import {trigger} from "./npmci.trigger";
import * as NpmciEnv from "./npmci.env";
let command; let command;
@ -34,19 +35,24 @@ if (typeof command === 'undefined') {
switch (command){ switch (command){
case "build": case "build":
build(commandOption); build(commandOption)
.then(NpmciEnv.configStore);
break; break;
case "install": case "install":
install(commandOption); install(commandOption)
.then(NpmciEnv.configStore);;
break; break;
case "prepare": case "prepare":
prepare(commandOption); prepare(commandOption)
.then(NpmciEnv.configStore);;
break; break;
case "publish": case "publish":
publish(commandOption); publish(commandOption)
.then(NpmciEnv.configStore);;
break; break;
case "test": case "test":
test(commandOption); test(commandOption)
.then(NpmciEnv.configStore);
break; break;
case "trigger": case "trigger":
trigger(); trigger();

View File

@ -249,7 +249,7 @@ export let dockerTag = function(repoArg:string,versionArg:string,stageArg:string
} }
let repo = repoArg; let repo = repoArg;
let version = versionArg; let version = versionArg;
if(NpmciEnv.buildStage == "build" || NpmciEnv.buildStage == "test"){ if(stageArg == "build" || stageArg == "test"){
version = version + "_test"; version = version + "_test";
} }
tagString = registry + "/" + repo + ":" + version; tagString = registry + "/" + repo + ":" + version;

View File

@ -13,9 +13,12 @@ export let dockerRegistry; // will be set by npmci.prepare
export let dockerFilesBuilt:Dockerfile[] = []; export let dockerFilesBuilt:Dockerfile[] = [];
export let dockerFiles:Dockerfile[] = []; export let dockerFiles:Dockerfile[] = [];
export let config;
export let configStore = () => { export let configStore = () => {
let config = {
dockerRegistry: dockerRegistry,
dockerFilesBuilt: dockerFilesBuilt,
dockerFiles: dockerFiles
}
plugins.smartfile.memory.toFsSync( plugins.smartfile.memory.toFsSync(
JSON.stringify(config), JSON.stringify(config),
{ {
@ -26,13 +29,14 @@ export let configStore = () => {
} }
export let configLoad = () => { export let configLoad = () => {
let config;
try { try {
config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig,"json"); config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig,"json");
} }
catch(err){ catch(err){
config = {}; config = {};
configStore(); configStore();
plugins.beautylog.log("config inititialized!"); plugins.beautylog.log("config initialized!");
} }
config.dockerRegistry ? dockerRegistry = config.dockerRegistry : void(0); config.dockerRegistry ? dockerRegistry = config.dockerRegistry : void(0);