diff --git a/dist/npmci.install.js b/dist/npmci.install.js index 85b285a..67016e0 100644 --- a/dist/npmci.install.js +++ b/dist/npmci.install.js @@ -8,10 +8,10 @@ exports.install = (versionArg) => { plugins.beautylog.log(`now installing node version ${versionArg}`); let version; if (versionArg == "stable") { - version = "6.6.0"; + version = "stable"; } else if (versionArg == "lts") { - version = "6.6.0"; + version = "--lts"; } else if (versionArg == "legacy") { version = "6.6.0"; @@ -33,4 +33,4 @@ exports.install = (versionArg) => { done.resolve(); return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuaW5zdGFsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF3QjtBQUN4QiwyQ0FBMkM7QUFDM0MsNkNBQW9DO0FBQ3BDLDZDQUEyQztBQUVoQyxRQUFBLE9BQU8sR0FBRyxDQUFDLFVBQVU7SUFDNUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQywrQkFBK0IsVUFBVSxFQUFFLENBQUMsQ0FBQztJQUNuRSxJQUFJLE9BQWUsQ0FBQztJQUNwQixFQUFFLENBQUMsQ0FBQyxVQUFVLElBQUksUUFBUSxDQUFDLENBQUMsQ0FBQztRQUN6QixPQUFPLEdBQUcsT0FBTyxDQUFDO0lBQ3RCLENBQUM7SUFBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUMsVUFBVSxJQUFJLEtBQUssQ0FBQyxDQUFDLENBQUM7UUFDN0IsT0FBTyxHQUFHLE9BQU8sQ0FBQztJQUN0QixDQUFDO0lBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLFVBQVUsSUFBSSxRQUF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DQUFDO0lBQ2YsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFBIn0= \ No newline at end of file diff --git a/dist/npmci.publish.js b/dist/npmci.publish.js index 70eb2ba..f71c20c 100644 --- a/dist/npmci.publish.js +++ b/dist/npmci.publish.js @@ -40,4 +40,4 @@ let publishDocker = function () { .then(done.resolve); return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kucHVibGlzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF3QjtBQUN4QiwyQ0FBMkM7QUFDM0MsbURBQXdDO0FBQ3hDLDZDQUFrQztBQUVsQyx5REFBd0Q7QUFPeEQ7OztHQUdHO0FBQ1EsUUFBQSxPQUFPLEdBQUcsQ0FBQyxhQUFhLEdBQWUsS0FBSztJQUNuRCxNQUFNLENBQUMsQ0FBQyxhQUFhLENBQUMsQ0FBQSxDQUFDO1FBQ25CLEtBQUssS0FBSztZQUNOLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUN4QixLQUFLLFFBQVE7WUFDVCxNQUFNLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDL0IsQ0FBQztBQUNMLENBQUMsQ0FBQztBQUVGOztHQUVHO0FBQ0gsSUFBSSxVQUFVLEdBQUk7SUFDZCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLHVCQUFPLENBQUMsS0FBSyxDQUFDO1NBQ1QsSUFBSSxDQUFDO1FBQ0YsaUJBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUNwQixPQUFPLENBQUMsU0FBUyxDQUFDL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MsYUFBYSxFQUFFLENBQUM7SUFDL0IsQ0FBQztBQUNMLENBQUMsQ0FBQztBQUVGOztHQUVHO0FBQ0gsSUFBSSxVQUFVLEdBQUk7SUFDZCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLHVCQUFPLENBQUMsS0FBSyxDQUFDO1NBQ1QsSUFBSSxDQUFDO1FBQ0YsaUJBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUNwQixPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBRTtRQUMvQixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDbkIsQ0FBQyxDQUFDLENBQUM7SUFDUixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN2QixDQUFDLENBQUE7QUFFRDs7R0FFRztBQUNILElBQUksYUFBYSxHQUFHO0lBQ2hCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDekIsZ0JBQWdCLENBQUMsZUFBZSxFQUFFO1NBQ2pDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxvQkFBb0IsQ0FBQztTQUMzQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsZUFBZSxDQUFDO1NBQ3RDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDeEIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0= \ No newline at end of file diff --git a/package.json b/package.json index a515bdb..216b86b 100644 --- a/package.json +++ b/package.json @@ -23,28 +23,28 @@ "homepage": "https://gitlab.com/pushrocks/npmci#README", "devDependencies": { "npmts-g": "^5.2.8", - "should": "^11.1.0", - "typings-test": "^1.0.2" + "should": "^11.1.1", + "typings-test": "^1.0.3" }, "dependencies": { - "@types/lodash": "^4.14.34", + "@types/lodash": "^4.14.39", "@types/q": "0.x.x", "@types/request": "0.x.x", - "@types/shelljs": "^0.3.30", - "beautylog": "^5.0.23", + "@types/shelljs": "^0.3.32", + "beautylog": "^6.0.0", "gulp": "^3.9.1", - "gulp-function": "^1.3.6", - "lodash": "^4.15.0", - "projectinfo": "^1.0.3", + "gulp-function": "^2.2.0", + "lodash": "^4.17.0", + "projectinfo": "^1.0.4", "q": "^1.4.1", - "request": "^2.74.0", - "shelljs": "^0.7.4", - "smartcli": "^1.0.9", - "smartfile": "^4.0.15", + "request": "^2.78.0", + "shelljs": "^0.7.5", + "smartcli": "^1.0.10", + "smartfile": "^4.1.0", "smartparam": "^0.1.1", - "smartsocket": "^1.1.4", + "smartsocket": "^1.1.7", "smartssh": "^1.1.5", - "smartstring": "^2.0.17", + "smartstring": "^2.0.22", "through2": "^2.0.1", "typings-global": "^1.0.14" } diff --git a/test/test.d.ts b/test/test.d.ts index b973566..2fd432a 100644 --- a/test/test.d.ts +++ b/test/test.d.ts @@ -1,2 +1 @@ -import "typings-test"; -import "should"; +import 'typings-test'; diff --git a/test/test.js b/test/test.js index 2f571af..85bfd0e 100644 --- a/test/test.js +++ b/test/test.js @@ -1,14 +1,14 @@ "use strict"; require("typings-test"); -require("should"); +const should = require("should"); const path = require("path"); const beautylog = require("beautylog"); -//set up environment -process.env.CI_BUILD_REPO = "https://yyyyyy:xxxxxxxx@gitlab.com/mygroup/myrepo.git"; -process.env.NPMCI_SSHKEY_1 = "hostString|somePrivKey|##"; -process.env.NPMTS_TEST = "true"; +// set up environment +process.env.CI_BUILD_REPO = 'https://yyyyyy:xxxxxxxx@gitlab.com/mygroup/myrepo.git'; +process.env.NPMCI_SSHKEY_1 = 'hostString|somePrivKey|##'; +process.env.NPMTS_TEST = 'true'; process.cwd = () => { - return path.join(__dirname, "assets/"); + return path.join(__dirname, 'assets/'); }; const NpmciBuildDocker = require("../dist/npmci.build.docker"); const NpmciPublish = require("../dist/npmci.publish"); @@ -17,70 +17,69 @@ const NpmciSsh = require("../dist/npmci.ssh"); let dockerfile1; let dockerfile2; let sortableArray; -describe("NPMCI", function () { - describe("build.docker", function () { - it("should return valid Dockerfiles", function () { - dockerfile1 = new NpmciBuildDocker.Dockerfile({ filePath: "./Dockerfile", read: true }); - dockerfile2 = new NpmciBuildDocker.Dockerfile({ filePath: "./Dockerfile_sometag1", read: true }); - dockerfile1.version.should.equal("latest"); - dockerfile2.version.should.equal("sometag1"); +describe('NPMCI', function () { + describe('build.docker', function () { + it('should return valid Dockerfiles', function () { + dockerfile1 = new NpmciBuildDocker.Dockerfile({ filePath: './Dockerfile', read: true }); + dockerfile2 = new NpmciBuildDocker.Dockerfile({ filePath: './Dockerfile_sometag1', read: true }); + should(dockerfile1.version).equal('latest'); + should(dockerfile2.version).equal('sometag1'); }); - it("should read a directory of Dockerfiles", function (done) { + it('should read a directory of Dockerfiles', function (done) { NpmciBuildDocker.readDockerfiles() .then(function (readDockerfilesArrayArg) { - readDockerfilesArrayArg[1].version.should.equal("sometag1"); + should(readDockerfilesArrayArg[1].version).equal('sometag1'); sortableArray = readDockerfilesArrayArg; done(); }); }); - it("should sort an array of Dockerfiles", function (done) { + it('should sort an array of Dockerfiles', function (done) { NpmciBuildDocker.sortDockerfiles(sortableArray) .then(function (sortedArrayArg) { - beautylog.success("final result"); + beautylog.success('final result'); console.log(sortedArrayArg); done(); }); }); - it("should correctly chain Dockerfile handling", function (done) { + it('should correctly chain Dockerfile handling', function (done) { NpmciBuildDocker.build() .then(() => { done(); }); }); }); - describe(".publish.docker", function () { - it("should publish all built Dockerfiles", function (done) { - NpmciPublish.publish("docker") + describe('.publish.docker', function () { + it('should publish all built Dockerfiles', function (done) { + NpmciPublish.publish('docker') .then(() => { done(); }); - ; }); }); - describe(".test.npm", function () { - it("should source nvm using bash and install a specific node version, then test it", function (done) { - NpmciTest.test("legacy") + describe('.test.npm', function () { + it('should source nvm using bash and install a specific node version, then test it', function (done) { + NpmciTest.test('legacy') .then(() => { - return NpmciTest.test("lts"); + return NpmciTest.test('lts'); }) .then(() => { - return NpmciTest.test("stable"); + return NpmciTest.test('stable'); }) .then(() => { done(); }); }); }); - describe("test.docker", function () { - it("should test dockerfiles", function (done) { - NpmciTest.test("docker") + describe('test.docker', function () { + it('should test dockerfiles', function (done) { + NpmciTest.test('docker') .then(() => { done(); }); }); }); - describe("npmci prepare ssh", function () { - it("should pick up SSH keys", function (done) { + describe('npmci prepare ssh', function () { + it('should pick up SSH keys', function (done) { NpmciSsh.ssh() .then(() => { done(); @@ -88,4 +87,4 @@ describe("NPMCI", function () { }); }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFzQjtBQUN0QixrQkFBZ0I7QUFDaEIsNkJBQThCO0FBQzlCLHVDQUFzQztBQUN0QyxvQkFBb0I7QUFDcEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxhQUFhLEdBQUcsdURBQXVELENBQUM7QUFDcEYsT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEdBQUcsMkJBQTJCLENBQUE7QUFDeEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLEdBQUcsTUFBTSxDQUFDO0FBQ2hDLE9BQU8sQ0FBQyxHQUFHLEdBQUc7SUFDVixNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUMsQ0FBQyxDQUFDO0FBSUYsK0RBQWdFO0FBQ2hFLHNEQUF1RDtBQUN2RCxnREFBaUQ7QUFDakQsOENBQThDO0FBRzlDLElBQUksV0FBdUMsQ0FBQztBQUM1QyxJQUFJLFdBQXVDLENBQUM7QUFDNUMsSUFBSSxhQUEyQyxDQUFDO0FBRWhELFFBQVE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BQ04sQ0FBQyxDQUFDLENBQUEifQ== \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index a8479d5..f3ca9a0 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,94 +1,101 @@ -import "typings-test"; -import "should"; -import path = require("path"); -import * as beautylog from "beautylog" -//set up environment -process.env.CI_BUILD_REPO = "https://yyyyyy:xxxxxxxx@gitlab.com/mygroup/myrepo.git"; -process.env.NPMCI_SSHKEY_1 = "hostString|somePrivKey|##" -process.env.NPMTS_TEST = "true"; +import 'typings-test' +import * as should from 'should' +import path = require('path') +import * as beautylog from 'beautylog' + +// set up environment +process.env.CI_BUILD_REPO = 'https://yyyyyy:xxxxxxxx@gitlab.com/mygroup/myrepo.git' +process.env.NPMCI_SSHKEY_1 = 'hostString|somePrivKey|##' +process.env.NPMTS_TEST = 'true' process.cwd = () => { - return path.join(__dirname,"assets/"); -}; + return path.join(__dirname,'assets/') +} -//require NPMCI files -import npmci = require("../dist/index"); -import NpmciBuildDocker = require("../dist/npmci.build.docker"); -import NpmciPublish = require("../dist/npmci.publish"); -import NpmciTest = require("../dist/npmci.test"); -import NpmciSsh = require("../dist/npmci.ssh") +// require NPMCI files +import npmci = require('../dist/index') +import NpmciBuildDocker = require('../dist/npmci.build.docker') +import NpmciPublish = require('../dist/npmci.publish') +import NpmciTest = require('../dist/npmci.test') +import NpmciSsh = require('../dist/npmci.ssh') -let dockerfile1:NpmciBuildDocker.Dockerfile; -let dockerfile2:NpmciBuildDocker.Dockerfile; -let sortableArray:NpmciBuildDocker.Dockerfile[]; +let dockerfile1: NpmciBuildDocker.Dockerfile +let dockerfile2: NpmciBuildDocker.Dockerfile +let sortableArray: NpmciBuildDocker.Dockerfile[] -describe("NPMCI",function(){ - describe("build.docker",function(){ - it("should return valid Dockerfiles",function(){ - dockerfile1 = new NpmciBuildDocker.Dockerfile({filePath:"./Dockerfile",read:true}); - dockerfile2 = new NpmciBuildDocker.Dockerfile({filePath:"./Dockerfile_sometag1",read:true}); - dockerfile1.version.should.equal("latest"); - dockerfile2.version.should.equal("sometag1"); - }); - it("should read a directory of Dockerfiles",function(done){ +describe('NPMCI',function(){ + describe('build.docker',function(){ + it('should return valid Dockerfiles',function(){ + dockerfile1 = new NpmciBuildDocker.Dockerfile({filePath: './Dockerfile', read: true}) + dockerfile2 = new NpmciBuildDocker.Dockerfile({filePath: './Dockerfile_sometag1', read: true}) + should(dockerfile1.version).equal('latest') + should(dockerfile2.version).equal('sometag1') + }) + + it('should read a directory of Dockerfiles',function(done){ NpmciBuildDocker.readDockerfiles() - .then(function(readDockerfilesArrayArg:NpmciBuildDocker.Dockerfile[]){ - readDockerfilesArrayArg[1].version.should.equal("sometag1"); + .then(function(readDockerfilesArrayArg: NpmciBuildDocker.Dockerfile[]){ + should(readDockerfilesArrayArg[1].version).equal('sometag1') sortableArray = readDockerfilesArrayArg - done(); - }); + done() + }) }) - it("should sort an array of Dockerfiles",function(done){ + + it('should sort an array of Dockerfiles',function(done){ NpmciBuildDocker.sortDockerfiles(sortableArray) - .then(function(sortedArrayArg:NpmciBuildDocker.Dockerfile[]){ - beautylog.success("final result"); - console.log(sortedArrayArg); - done(); + .then(function(sortedArrayArg: NpmciBuildDocker.Dockerfile[]){ + beautylog.success('final result') + console.log(sortedArrayArg) + done() }) - }); - it("should correctly chain Dockerfile handling",function(done){ + }) + + it('should correctly chain Dockerfile handling', function(done){ NpmciBuildDocker.build() - .then(()=>{ - done(); - }); - }) - }); - describe(".publish.docker",function(){ - it("should publish all built Dockerfiles",function(done){ - NpmciPublish.publish("docker") .then(() => { - done(); - });; - }); - }); - describe(".test.npm",function(){ - it("should source nvm using bash and install a specific node version, then test it",function(done){ - NpmciTest.test("legacy") - .then(() => { - return NpmciTest.test("lts"); - }) - .then(() => { - return NpmciTest.test("stable"); - }) - .then(() => { - done(); - }); - }) - }); - describe("test.docker",function(){ - it("should test dockerfiles",function(done){ - NpmciTest.test("docker") - .then(() => { - done(); - }); - }) - }); - describe("npmci prepare ssh",function(){ - it("should pick up SSH keys",function(done){ - NpmciSsh.ssh() - .then(() => { - done(); + done() }) }) }) -}) \ No newline at end of file + + describe('.publish.docker',function(){ + it('should publish all built Dockerfiles',function(done){ + NpmciPublish.publish('docker') + .then(() => { + done() + }) + }) + }) + + describe('.test.npm',function(){ + it('should source nvm using bash and install a specific node version, then test it',function(done){ + NpmciTest.test('legacy') + .then(() => { + return NpmciTest.test('lts') + }) + .then(() => { + return NpmciTest.test('stable') + }) + .then(() => { + done() + }) + }) + }) + + describe('test.docker',function(){ + it('should test dockerfiles',function(done){ + NpmciTest.test('docker') + .then(() => { + done() + }) + }) + }); + describe('npmci prepare ssh',function(){ + it('should pick up SSH keys',function(done){ + NpmciSsh.ssh() + .then(() => { + done() + }) + }) + }) +}) diff --git a/ts/npmci.install.ts b/ts/npmci.install.ts index 8de3c41..8d98e85 100644 --- a/ts/npmci.install.ts +++ b/ts/npmci.install.ts @@ -8,9 +8,9 @@ export let install = (versionArg) => { plugins.beautylog.log(`now installing node version ${versionArg}`); let version: string; if (versionArg == "stable") { - version = "6.6.0"; + version = "stable"; } else if (versionArg == "lts") { - version = "6.6.0"; + version = "--lts"; } else if (versionArg == "legacy") { version = "6.6.0" } else { diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..45052ad --- /dev/null +++ b/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "tslint-config-standard" +}