some cosmetics
This commit is contained in:
16
ts/index.ts
16
ts/index.ts
@@ -13,6 +13,7 @@ import {prepare} from "./npmci.prepare";
|
||||
import {tag, retag} from "./npmci.tag";
|
||||
import {test} from "./npmci.test";
|
||||
import {trigger} from "./npmci.trigger";
|
||||
import * as NpmciEnv from "./npmci.env";
|
||||
|
||||
|
||||
let command;
|
||||
@@ -34,19 +35,24 @@ if (typeof command === 'undefined') {
|
||||
|
||||
switch (command){
|
||||
case "build":
|
||||
build(commandOption);
|
||||
build(commandOption)
|
||||
.then(NpmciEnv.configStore);
|
||||
break;
|
||||
case "install":
|
||||
install(commandOption);
|
||||
install(commandOption)
|
||||
.then(NpmciEnv.configStore);;
|
||||
break;
|
||||
case "prepare":
|
||||
prepare(commandOption);
|
||||
prepare(commandOption)
|
||||
.then(NpmciEnv.configStore);;
|
||||
break;
|
||||
case "publish":
|
||||
publish(commandOption);
|
||||
publish(commandOption)
|
||||
.then(NpmciEnv.configStore);;
|
||||
break;
|
||||
case "test":
|
||||
test(commandOption);
|
||||
test(commandOption)
|
||||
.then(NpmciEnv.configStore);
|
||||
break;
|
||||
case "trigger":
|
||||
trigger();
|
||||
|
@@ -249,7 +249,7 @@ export let dockerTag = function(repoArg:string,versionArg:string,stageArg:string
|
||||
}
|
||||
let repo = repoArg;
|
||||
let version = versionArg;
|
||||
if(NpmciEnv.buildStage == "build" || NpmciEnv.buildStage == "test"){
|
||||
if(stageArg == "build" || stageArg == "test"){
|
||||
version = version + "_test";
|
||||
}
|
||||
tagString = registry + "/" + repo + ":" + version;
|
||||
|
@@ -13,9 +13,12 @@ export let dockerRegistry; // will be set by npmci.prepare
|
||||
export let dockerFilesBuilt:Dockerfile[] = [];
|
||||
export let dockerFiles:Dockerfile[] = [];
|
||||
|
||||
export let config;
|
||||
|
||||
export let configStore = () => {
|
||||
let config = {
|
||||
dockerRegistry: dockerRegistry,
|
||||
dockerFilesBuilt: dockerFilesBuilt,
|
||||
dockerFiles: dockerFiles
|
||||
}
|
||||
plugins.smartfile.memory.toFsSync(
|
||||
JSON.stringify(config),
|
||||
{
|
||||
@@ -26,13 +29,14 @@ export let configStore = () => {
|
||||
}
|
||||
|
||||
export let configLoad = () => {
|
||||
let config;
|
||||
try {
|
||||
config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig,"json");
|
||||
}
|
||||
catch(err){
|
||||
config = {};
|
||||
configStore();
|
||||
plugins.beautylog.log("config inititialized!");
|
||||
plugins.beautylog.log("config initialized!");
|
||||
}
|
||||
|
||||
config.dockerRegistry ? dockerRegistry = config.dockerRegistry : void(0);
|
||||
|
Reference in New Issue
Block a user