36 lines
3.9 KiB
JavaScript
36 lines
3.9 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUVsQyxJQUFZLGdCQUFnQixXQUFNLHNCQUVsQyxDQUFDLENBRnVEO0FBRTdDLGVBQU8sR0FBRyxVQUFDLFVBQXlCO0lBQXpCLDBCQUF5QixHQUF6QixrQkFBeUI7SUFDM0MsTUFBTSxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUE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