npmci/dist/npmci.publish.js

38 lines
3.7 KiB
JavaScript
Raw Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
2016-06-01 03:44:48 +00:00
var npmci_prepare_1 = require("./npmci.prepare");
2016-05-30 01:40:07 +00:00
var npmci_bash_1 = require("./npmci.bash");
2016-06-03 14:27:12 +00:00
var env = require("./npmci.env");
2016-06-01 03:44:48 +00:00
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
switch (serviceArg) {
case "npm":
2016-06-03 14:27:12 +00:00
return publishNpm();
2016-06-01 03:44:48 +00:00
case "docker":
2016-06-03 14:27:12 +00:00
return publishDocker();
2016-05-30 03:13:15 +00:00
}
2016-06-01 03:44:48 +00:00
};
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();
npmci_prepare_1.prepare("docker")
.then(function () {
2016-06-03 14:27:12 +00:00
npmci_bash_1.bash;
npmci_bash_1.bash("docker push " + env.dockerTag());
2016-06-02 11:08:15 +00:00
done.resolve();
2016-06-01 03:44:48 +00:00
});
2016-05-30 00:29:30 +00:00
return done.promise;
};
2016-06-04 21:20:39 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyxJQUFZLEdBQUcsV0FBTSxhQUFhLENBQUMsQ0FB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