now using bash for everything

This commit is contained in:
Philipp Kunz 2016-05-30 03:40:07 +02:00
parent 5632bd5d0b
commit 77ce4eea00
10 changed files with 47 additions and 20 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# NPMCI
npmci is your friend when it comes to handling npm packages during CI builds.
It is designed to work hand in hand with npmts

2
dist/npmci.bash.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import "typings-global";
export declare let bash: (commandArg: any) => void;

10
dist/npmci.bash.js vendored Normal file
View File

@ -0,0 +1,10 @@
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
exports.bash = function (commandArg) {
plugins.shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh &&" +
commandArg +
"\"");
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmJhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQ2hDLFlBQUksR0FBRyxVQUFDLFVBQVU7SUFDekIsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQ2hCLDJDQUEyQztRQUMzQyxVQUFVO1FBQ1YsSUFBSSxDQUNQLENBQUM7QUFDTixDQUFDLENBQUEiLCJmaWxlIjoibnBtY2kuYmFzaC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XHJcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xyXG5leHBvcnQgbGV0IGJhc2ggPSAoY29tbWFuZEFyZykgPT4ge1xyXG4gICAgcGx1Z2lucy5zaGVsbGpzLmV4ZWMoXHJcbiAgICAgICAgXCJiYXNoIC1jIFxcXCJzb3VyY2UgL3Vzci9sb2NhbC9udm0vbnZtLnNoICYmXCIgK1xyXG4gICAgICAgIGNvbW1hbmRBcmcgK1xyXG4gICAgICAgIFwiXFxcIlwiXHJcbiAgICApO1xyXG59Il19

10
dist/npmci.install.js vendored
View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
require("typings-global"); require("typings-global");
var plugins = require("./npmci.plugins"); var plugins = require("./npmci.plugins");
var npmci_bash_1 = require("./npmci.bash");
exports.install = function (versionArg) { exports.install = function (versionArg) {
var done = plugins.q.defer(); var done = plugins.q.defer();
var version; var version;
@ -12,11 +13,8 @@ exports.install = function (versionArg) {
} }
; ;
plugins.beautylog.log("now installing " + "node ".green + ("version " + version).yellow); plugins.beautylog.log("now installing " + "node ".green + ("version " + version).yellow);
plugins.shelljs.exec("bash -c \"source /usr/local/nvm/nvm.sh && nvm install " + npmci_bash_1.bash("nvm install " + version +
version + " nvm alias default " + version);
" nvm alias default " +
version +
"\"");
plugins.beautylog.success("Node version " + version + " successfully installed!"); plugins.beautylog.success("Node version " + version + " successfully installed!");
plugins.shelljs.exec("node -v"); plugins.shelljs.exec("node -v");
plugins.shelljs.exec("npm -v"); plugins.shelljs.exec("npm -v");
@ -24,4 +22,4 @@ exports.install = function (versionArg) {
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQ2hDLGVBQU8sR0FBRyxVQUFDLFVBQVU7SUFDNUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixJQUFJLE9BQWMsQ0FBQztJQUNuQixFQUFFLENBQUEsQ0FBQyxVQUFVLEdBQUcsS0FBSyxDQUFD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 @@
"use strict"; "use strict";
require("typings-global"); require("typings-global");
var plugins = require("./npmci.plugins"); var plugins = require("./npmci.plugins");
var npmci_bash_1 = require("./npmci.bash");
var npmrcPrefix = "//registry.npmjs.org/:_authToken="; var npmrcPrefix = "//registry.npmjs.org/:_authToken=";
var npmToken = process.env.NPMCITOKEN; var npmToken = process.env.NPMCITOKEN;
var npmrcFileString = npmrcPrefix + npmToken; var npmrcFileString = npmrcPrefix + npmToken;
@ -8,9 +9,9 @@ exports.publish = function () {
var done = plugins.q.defer(); var done = plugins.q.defer();
plugins.beautylog.ok("Tests passed, now publishing to npm!"); plugins.beautylog.ok("Tests passed, now publishing to npm!");
plugins.smartfile.memory.toFs(npmrcFileString, { fileName: ".npmrc", filePath: "/root/" }); plugins.smartfile.memory.toFs(npmrcFileString, { fileName: ".npmrc", filePath: "/root/" });
plugins.shelljs.exec("npm publish"); npmci_bash_1.bash("npm publish");
plugins.beautylog.ok("Done!"); plugins.beautylog.ok("Done!");
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBRTNDLElBQUksV0FBVyxHQUFVLG1DQUFtQyxDQUFDO0FBQzdELElBQUksUUFBUSxHQUFVLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDO0FBQzdDLElBQUksZUFBZSxHQUFHLFdBQVcsR0FBRyxRQUFRLENBQUM7QUFHbEMsZUFBTyxHQUFHO0lBQ2pCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENB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FBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMiLCJmaWxlIjoibnBtY2kucHVibGlzaC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XHJcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xyXG5pbXBvcnQge2Jhc2h9IGZyb20gXCIuL25wbWNpLmJhc2hcIjtcclxuXHJcbmxldCBucG1yY1ByZWZpeDpzdHJpbmcgPSBcIi8vcmVnaXN0cnkubnBtanMub3JnLzpfYXV0aFRva2VuPVwiO1xyXG5sZXQgbnBtVG9rZW46c3RyaW5nID0gcHJvY2Vzcy5lbnYuTlBNQ0lUT0tFTjtcclxubGV0IG5wbXJjRmlsZVN0cmluZyA9IG5wbXJjUHJlZml4ICsgbnBtVG9rZW47XHJcblxyXG5cclxuZXhwb3J0IGxldCBwdWJsaXNoID0gKCkgPT4ge1xyXG4gICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcclxuICAgIHBsdWdpbnMuYmVhdXR5bG9nLm9rKFwiVGVzdHMgcGFzc2VkLCBub3cgcHVibGlzaGluZyB0byBucG0hXCIpO1xyXG4gICAgcGx1Z2lucy5zbWFydGZpbGUubWVtb3J5LnRvRnMobnBtcmNGaWxlU3RyaW5nLHtmaWxlTmFtZTpcIi5ucG1yY1wiLGZpbGVQYXRoOlwiL3Jvb3QvXCJ9KTtcclxuICAgIGJhc2goXCJucG0gcHVibGlzaFwiKTtcclxuICAgIHBsdWdpbnMuYmVhdXR5bG9nLm9rKFwiRG9uZSFcIilcclxuICAgIHJldHVybiBkb25lLnByb21pc2U7XHJcbn07Il19

7
dist/npmci.test.js vendored
View File

@ -1,19 +1,20 @@
"use strict"; "use strict";
require("typings-global"); require("typings-global");
var plugins = require("./npmci.plugins"); var plugins = require("./npmci.plugins");
var npmci_bash_1 = require("./npmci.bash");
var npmci_install_1 = require("./npmci.install"); var npmci_install_1 = require("./npmci.install");
exports.test = function (versionArg) { exports.test = function (versionArg) {
var done = plugins.q.defer(); var done = plugins.q.defer();
npmci_install_1.install(versionArg) npmci_install_1.install(versionArg)
.then(function () { .then(function () {
plugins.beautylog.info("now installing dependencies:"); plugins.beautylog.info("now installing dependencies:");
plugins.shelljs.exec("npm install"); npmci_bash_1.bash("npm install");
plugins.beautylog.info("now starting tests:"); plugins.beautylog.info("now starting tests:");
plugins.shelljs.exec("npm test"); npmci_bash_1.bash("npm test");
plugins.beautylog.success("test finished"); plugins.beautylog.success("test finished");
done.resolve(); done.resolve();
}); });
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQzdCLFlBQUksR0FBRyxVQUFDLFVBQVU7SUFDekIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3Qix1QkFBTyxDQUFDLFVBQVUsQ0FBQztTQUNkLElBQUksQ0FBQztRQUNGLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLDhCQUE4QixDQUFDLENBQUM7UUFDdkQsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDcEMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMscUJBQXFCLENBQUMsQ0FBQztRQUM5QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUNqQyxPQU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G9ydCB7YmFzaH0gZnJvbSBcIi4vbnBtY2kuYmFzaFwiO1xyXG5pbXBvcnQge2luc3RhbGx9IGZyb20gXCIuL25wbWNpLmluc3RhbGxcIjtcclxuXHJcbmV4cG9ydCBsZXQgdGVzdCA9ICh2ZXJzaW9uQXJnKSA9PiB7XHJcbiAgICBsZXQgZG9uZSA9IHBsdWdpbnMucS5kZWZlcigpO1xyXG4gICAgaW5zdGFsbCh2ZXJzaW9uQXJnKVxyXG4gICAgICAgIC50aGVuKGZ1bmN0aW9uKCl7XHJcbiAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmluZm8oXCJub3cgaW5zdGFsbGluZyBkZXBlbmRlbmNpZXM6XCIpO1xyXG4gICAgICAgICAgICBiYXNoKFwibnBtIGluc3RhbGxcIik7XHJcbiAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmluZm8oXCJub3cgc3RhcnRpbmcgdGVzdHM6XCIpO1xyXG4gICAgICAgICAgICBiYXNoKFwibnBtIHRlc3RcIik7XHJcbiAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLnN1Y2Nlc3MoXCJ0ZXN0IGZpbmlzaGVkXCIpO1xyXG4gICAgICAgICAgICBkb25lLnJlc29sdmUoKTtcclxuICAgICAgICB9KVxyXG4gICAgcmV0dXJuIGRvbmUucHJvbWlzZTtcclxufSJdfQ==

9
ts/npmci.bash.ts Normal file
View File

@ -0,0 +1,9 @@
import "typings-global";
import * as plugins from "./npmci.plugins";
export let bash = (commandArg) => {
plugins.shelljs.exec(
"bash -c \"source /usr/local/nvm/nvm.sh &&" +
commandArg +
"\""
);
}

View File

@ -1,5 +1,7 @@
import "typings-global"; import "typings-global";
import * as plugins from "./npmci.plugins"; import * as plugins from "./npmci.plugins";
import {bash} from "./npmci.bash";
export let install = (versionArg) => { export let install = (versionArg) => {
let done = plugins.q.defer(); let done = plugins.q.defer();
let version:string; let version:string;
@ -9,12 +11,9 @@ export let install = (versionArg) => {
version = versionArg; version = versionArg;
}; };
plugins.beautylog.log("now installing " + "node ".green + ("version " + version).yellow); plugins.beautylog.log("now installing " + "node ".green + ("version " + version).yellow);
plugins.shelljs.exec( bash(
"bash -c \"source /usr/local/nvm/nvm.sh && nvm install "+ "nvm install " + version +
version + " nvm alias default " + version
" nvm alias default " +
version +
"\""
); );
plugins.beautylog.success("Node version " + version + " successfully installed!"); plugins.beautylog.success("Node version " + version + " successfully installed!");
plugins.shelljs.exec("node -v"); plugins.shelljs.exec("node -v");

View File

@ -1,5 +1,6 @@
import "typings-global"; import "typings-global";
import * as plugins from "./npmci.plugins"; import * as plugins from "./npmci.plugins";
import {bash} from "./npmci.bash";
let npmrcPrefix:string = "//registry.npmjs.org/:_authToken="; let npmrcPrefix:string = "//registry.npmjs.org/:_authToken=";
let npmToken:string = process.env.NPMCITOKEN; let npmToken:string = process.env.NPMCITOKEN;
@ -10,7 +11,7 @@ export let publish = () => {
let done = plugins.q.defer(); let done = plugins.q.defer();
plugins.beautylog.ok("Tests passed, now publishing to npm!"); plugins.beautylog.ok("Tests passed, now publishing to npm!");
plugins.smartfile.memory.toFs(npmrcFileString,{fileName:".npmrc",filePath:"/root/"}); plugins.smartfile.memory.toFs(npmrcFileString,{fileName:".npmrc",filePath:"/root/"});
plugins.shelljs.exec("npm publish"); bash("npm publish");
plugins.beautylog.ok("Done!") plugins.beautylog.ok("Done!")
return done.promise; return done.promise;
}; };

View File

@ -1,14 +1,16 @@
import "typings-global"; import "typings-global";
import * as plugins from "./npmci.plugins"; import * as plugins from "./npmci.plugins";
import {bash} from "./npmci.bash";
import {install} from "./npmci.install"; import {install} from "./npmci.install";
export let test = (versionArg) => { export let test = (versionArg) => {
let done = plugins.q.defer(); let done = plugins.q.defer();
install(versionArg) install(versionArg)
.then(function(){ .then(function(){
plugins.beautylog.info("now installing dependencies:"); plugins.beautylog.info("now installing dependencies:");
plugins.shelljs.exec("npm install"); bash("npm install");
plugins.beautylog.info("now starting tests:"); plugins.beautylog.info("now starting tests:");
plugins.shelljs.exec("npm test"); bash("npm test");
plugins.beautylog.success("test finished"); plugins.beautylog.success("test finished");
done.resolve(); done.resolve();
}) })