npmci/dist/npmci.env.js

37 lines
4.7 KiB
JavaScript
Raw Normal View History

2016-06-02 15:57:01 +00:00
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
var paths = require("./npmci.paths");
var smartstring_1 = require("smartstring");
exports.repo = new smartstring_1.GitRepo(process.env.CI_BUILD_REPO);
exports.buildStage = process.env.CI_BUILD_STAGE;
exports.dockerFilesBuilt = [];
exports.dockerFiles = [];
2016-06-05 21:53:01 +00:00
exports.configStore = function () {
2016-06-07 10:36:00 +00:00
var config = {
dockerRegistry: exports.dockerRegistry,
dockerFilesBuilt: exports.dockerFilesBuilt,
dockerFiles: exports.dockerFiles
};
plugins.smartfile.memory.toFsSync(JSON.stringify(config), {
2016-06-05 21:53:01 +00:00
fileName: "config.json",
filePath: paths.NpmciPackageRoot
});
};
exports.configLoad = function () {
2016-06-07 10:36:00 +00:00
var config;
2016-06-05 21:53:01 +00:00
try {
2016-06-07 10:36:00 +00:00
config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig, "json");
2016-06-05 21:53:01 +00:00
}
catch (err) {
2016-06-07 10:36:00 +00:00
config = {};
2016-06-05 21:53:01 +00:00
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-07 10:36:00 +00:00
config.dockerRegistry ? exports.dockerRegistry = config.dockerRegistry : void (0);
config.dockerFilesBuilt ? exports.dockerFilesBuilt = config.dockerFilesBuilt : void (0);
};
2016-06-05 21:53:01 +00:00
exports.configLoad();
2016-06-02 15:57:01 +00:00
2016-06-07 10:36:00 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM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