2016-06-02 15:57:01 +00:00
|
|
|
"use strict";
|
2016-06-03 00:56:20 +00:00
|
|
|
require("typings-global");
|
2016-07-18 14:56:53 +00:00
|
|
|
const plugins = require("./npmci.plugins");
|
|
|
|
const paths = require("./npmci.paths");
|
|
|
|
const smartstring_1 = require("smartstring");
|
2016-06-10 06:07:04 +00:00
|
|
|
if (process.env.CI_BUILD_REPO)
|
|
|
|
exports.repo = new smartstring_1.GitRepo(process.env.CI_BUILD_REPO);
|
2016-06-05 20:51:59 +00:00
|
|
|
exports.buildStage = process.env.CI_BUILD_STAGE;
|
2016-06-05 03:16:14 +00:00
|
|
|
exports.dockerFilesBuilt = [];
|
|
|
|
exports.dockerFiles = [];
|
2016-06-26 02:40:58 +00:00
|
|
|
exports.config = {
|
2016-06-26 03:21:24 +00:00
|
|
|
dockerRegistry: undefined,
|
2016-06-26 02:40:58 +00:00
|
|
|
dockerFilesBuilt: exports.dockerFilesBuilt,
|
|
|
|
dockerFiles: exports.dockerFiles,
|
|
|
|
project: undefined
|
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
exports.configStore = () => {
|
2016-06-26 03:21:24 +00:00
|
|
|
exports.config.dockerRegistry = exports.dockerRegistry;
|
2016-06-26 02:40:58 +00:00
|
|
|
plugins.smartfile.memory.toFsSync(JSON.stringify(exports.config), paths.NpmciPackageConfig);
|
2016-06-05 21:53:01 +00:00
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
let configLoad = () => {
|
2016-06-19 00:30:50 +00:00
|
|
|
// internal config to transfer information in between npmci shell calls
|
2016-06-05 21:53:01 +00:00
|
|
|
try {
|
2016-06-26 02:40:58 +00:00
|
|
|
plugins.lodash.assign(exports.config, plugins.smartfile.fs.toObjectSync(paths.NpmciPackageConfig, "json"));
|
2016-06-05 21:53:01 +00:00
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
exports.configStore();
|
2016-06-07 10:36:00 +00:00
|
|
|
plugins.beautylog.log("config initialized!");
|
2016-06-05 21:53:01 +00:00
|
|
|
}
|
2016-06-19 00:30:50 +00:00
|
|
|
// project config
|
|
|
|
try {
|
|
|
|
if (!exports.config.project) {
|
2016-06-23 20:22:03 +00:00
|
|
|
exports.config.project = plugins.smartfile.fs.toObjectSync(paths.NpmciProjectDir, "npmci.json");
|
2016-06-19 00:30:50 +00:00
|
|
|
plugins.beautylog.ok("project config found!");
|
|
|
|
}
|
|
|
|
;
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
exports.config.project = {};
|
|
|
|
plugins.beautylog.log("no project config found, so proceeding with default behaviour!");
|
|
|
|
}
|
|
|
|
exports.config.dockerRegistry ? exports.dockerRegistry = exports.config.dockerRegistry : void (0);
|
|
|
|
exports.config.dockerFilesBuilt ? exports.dockerFilesBuilt = exports.config.dockerFilesBuilt : void (0);
|
2016-06-05 21:24:11 +00:00
|
|
|
};
|
2016-06-19 00:30:50 +00:00
|
|
|
configLoad();
|
2016-07-18 14:56:53 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuZW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDeEIsTUFBWSxPQUFPLFdBQU0saUJBQWlCLENBQUMsQ0FBQTtBQUMzQyxNQUFZLEtBQUssV0FBTSxlQUFlLENBQUMsQ0FBQTtBQUN2Qyw4QkFBc0IsYUFBYSxDQUFDLENBQUE7QUFJcEMsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUM7SUFBQyxZQUFJLEdBQUcsSUFBSSxxQkFBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7QUFFakUsa0JBQVUsR0FBVSxPQUFPLENBQUMsR0FBR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