npmci/dist/npmci.env.js
PhilKunz External b6a85319b0 Go modular
2017-05-18 20:40:09 +00:00

49 lines
4.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmci.plugins");
const paths = require("./npmci.paths");
const smartstring_1 = require("smartstring");
if (process.env.CI_REPOSITORY_URL) {
exports.repo = new smartstring_1.GitRepo(process.env.CI_REPOSITORY_URL);
}
exports.buildStage = process.env.CI_BUILD_STAGE;
exports.setDockerRegistry = (dockerRegistryArg) => {
exports.dockerRegistry = dockerRegistryArg;
};
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuZW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMkNBQTBDO0FBQzFDLH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