46 lines
3.9 KiB
JavaScript
46 lines
3.9 KiB
JavaScript
"use strict";
|
|
require("typings-global");
|
|
const plugins = require("./npmci.plugins");
|
|
const paths = require("./npmci.paths");
|
|
const smartstring_1 = require("smartstring");
|
|
if (process.env.CI_BUILD_REPO)
|
|
exports.repo = new smartstring_1.GitRepo(process.env.CI_BUILD_REPO);
|
|
exports.buildStage = process.env.CI_BUILD_STAGE;
|
|
exports.dockerFilesBuilt = [];
|
|
exports.dockerFiles = [];
|
|
exports.config = {
|
|
dockerRegistry: undefined,
|
|
dockerFilesBuilt: exports.dockerFilesBuilt,
|
|
dockerFiles: exports.dockerFiles,
|
|
project: undefined
|
|
};
|
|
exports.configStore = () => {
|
|
exports.config.dockerRegistry = exports.dockerRegistry;
|
|
plugins.smartfile.memory.toFsSync(JSON.stringify(exports.config), paths.NpmciPackageConfig);
|
|
};
|
|
let configLoad = () => {
|
|
// internal config to transfer information in between npmci shell calls
|
|
try {
|
|
plugins.lodash.assign(exports.config, plugins.smartfile.fs.toObjectSync(paths.NpmciPackageConfig, "json"));
|
|
}
|
|
catch (err) {
|
|
exports.configStore();
|
|
plugins.beautylog.log("config initialized!");
|
|
}
|
|
// project config
|
|
try {
|
|
if (!exports.config.project) {
|
|
exports.config.project = plugins.smartfile.fs.toObjectSync(paths.NpmciProjectDir, "npmci.json");
|
|
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);
|
|
};
|
|
configLoad();
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnB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