npmci/dist/npmci.publish.js

36 lines
3.8 KiB
JavaScript

"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
var npmci_prepare_1 = require("./npmci.prepare");
var npmci_bash_1 = require("./npmci.bash");
var NpmciBuildDocker = require("./npmci.build.docker");
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
switch (serviceArg) {
case "npm":
return publishNpm();
case "docker":
return publishDocker();
}
};
var publishNpm = function () {
var done = plugins.q.defer();
npmci_prepare_1.prepare("npm")
.then(function () {
npmci_bash_1.bash("npm publish");
plugins.beautylog.ok("Done!");
done.resolve();
});
return done.promise;
};
var publishDocker = function () {
var done = plugins.q.defer();
NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.releaseDockerfiles)
.then(done.resolve);
return done.promise;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUVsQyxJQUFZLGdCQUFnQixXQUFNLHNCQUVsQyxDQUFDLENBRnVEO0FBRTdDLGVBQU8sR0FBRyxVQUFDLFVBQXlCO0lBQXpCLDBCQUF5QixHQUF6QixrQkFBeUI7SUFDM0MsTUFBTSxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUEsQ0FBQztRQUNoQixLQUFLLEtBQUs7WUFDTixNQUFNLENBQUMsVUFBVSxFQUFFLENBQUM7UUFDeEIsS0FBSyxRQUFRO1lBQ1QsTUFBTSxDQUFDLGFBQWEsRUFBRSxDQUFDO0lBQy9CLENBQU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