feat(logging): use smartlog

This commit is contained in:
Philipp Kunz 2018-11-24 15:00:19 +01:00
parent 8604c63d37
commit 0079addfc5
20 changed files with 594 additions and 300 deletions

View File

@ -135,13 +135,3 @@ pages:
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

413
package-lock.json generated
View File

@ -28,9 +28,9 @@
}
},
"@gitzone/tsrun": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.1.12.tgz",
"integrity": "sha512-DOxqOg+evoxhgbzhzH4u6LaPF+6bpMsnBVl1QQaHzKPGBlNjaIY4yJ0RsGnWMgX1hlNLvbgHtl0Ky4A2MDvyrg==",
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.1.13.tgz",
"integrity": "sha512-yJLXfqu33zGc1hBX4HGxzlBvb5DU2zs80MUd8UsULJvkgOBofb3XR7eyV7iZfP097sd+ABj17yoeqJcRRjOZTg==",
"dev": true,
"requires": {
"@gitzone/tsbuild": "^2.0.22",
@ -59,7 +59,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@pushrocks/consolecolor/-/consolecolor-2.0.1.tgz",
"integrity": "sha512-iOFCHVeFZ2OywbdwSxVI4/wokkcLrXVdHLgvMmkNhJ220eeLgjNZWx3EJo3vNW3zq5ybCSCUIq0878djBxrWpw==",
"dev": true,
"requires": {
"ansi-256-colors": "^1.1.0"
}
@ -75,14 +74,15 @@
}
},
"@pushrocks/lik": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@pushrocks/lik/-/lik-3.0.1.tgz",
"integrity": "sha512-6dwRg7WMdY9drlqfo6NzOcw5ubVWYvIOSSMZz4Jsojpa8aDVwXd2VkD7sxO/PJRrbZzHkx/JXoY/epcWRjngUw==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@pushrocks/lik/-/lik-3.0.2.tgz",
"integrity": "sha512-E2kI0jmPBGVfvXpmGEZOiv7amZrAIBpI49WL/gIdMy9MVeo6+k2VLDvYtdjzayVviE+LEt3//Xe08xE74FbP1A==",
"requires": {
"@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartpromise": "^2.0.5",
"@types/lodash": "^4.14.112",
"@pushrocks/smartrx": "^2.0.2",
"@pushrocks/smarttime": "^3.0.5",
"@types/minimatch": "^3.0.3",
"lodash": "^4.17.10",
"minimatch": "^3.0.4",
"symbol-tree": "^3.2.2"
}
@ -112,17 +112,17 @@
}
},
"@pushrocks/smartcli": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@pushrocks/smartcli/-/smartcli-3.0.4.tgz",
"integrity": "sha512-ZuCPIZD+vPHmNP6BLdhP+GTptZEnLeGhUsykWss47MbZ0FvGeXm1r939qsx/wwijGT3F1rQIHkDA74VdQ2VDmw==",
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/@pushrocks/smartcli/-/smartcli-3.0.6.tgz",
"integrity": "sha512-fCggmQXiu1URqMmzIta/8eBkBEfeWHwoErzQNTPFGpyVHw2Yhb5HBsatXUZUX5rBB+1o9xny9IzkLGyjI0lCww==",
"requires": {
"@pushrocks/lik": "^3.0.1",
"@pushrocks/smartlog": "^2.0.1",
"@pushrocks/smartparam": "^1.0.4",
"@pushrocks/smartpromise": "^2.0.5",
"@types/yargs": "^11.1.1",
"rxjs": "^6.3.0",
"smartparam": "1.0.2",
"yargs": "^12.0.1"
"rxjs": "^6.3.2",
"yargs": "^12.0.2"
}
},
"@pushrocks/smartdelay": {
@ -134,33 +134,71 @@
}
},
"@pushrocks/smartfile": {
"version": "6.0.8",
"resolved": "https://registry.npmjs.org/@pushrocks/smartfile/-/smartfile-6.0.8.tgz",
"integrity": "sha512-YkAovvQ0pcVphXLynlQ1D4nhEoUqALqqUn2pRXc2vXNy0RDSU22puLlLVhoXT0NPAqYNMazhqc4OAixgEOpdFw==",
"version": "6.0.11",
"resolved": "https://registry.npmjs.org/@pushrocks/smartfile/-/smartfile-6.0.11.tgz",
"integrity": "sha512-qITfYEUtSN478CFyYX0KatIYLV28u/KdO3ClOcKjx1epagpuYhkwfVELhyIDRvapMjuesoVgZcrXUhcvq0o9+w==",
"requires": {
"@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartrequest": "^1.1.14",
"@types/fs-extra": "^5.0.4",
"@types/vinyl": "^2.0.2",
"fs-extra": "^7.0.0",
"glob": "^7.1.2",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
"js-yaml": "^3.10.0",
"vinyl-file": "^3.0.0"
},
"dependencies": {
"fs-extra": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
"integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
}
}
},
"@pushrocks/smartlog": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog/-/smartlog-2.0.1.tgz",
"integrity": "sha512-GtsDTGIUF3VuWPyF8FV5dF31ZCEIcaJ56ZlvJsWxjnyJq57X25mk5/K0QAaRE9IIeHg6fORcukFomb5C+AOQrg==",
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog/-/smartlog-2.0.9.tgz",
"integrity": "sha512-F2u3O8OOQ7QXgg9o0lI7HnqEhSQZo2A8u0EuNbQH+Kj2oL62xDwjAg6KkINwH7ObSWpaldZ+I28prG0JxaRzvg==",
"requires": {
"@pushrocks/smartlog-interfaces": "^1.0.9"
"@pushrocks/smartlog-interfaces": "^2.0.2"
}
},
"@pushrocks/smartlog-destination-local": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-destination-local/-/smartlog-destination-local-7.0.5.tgz",
"integrity": "sha512-++SVz8hkCtqmMdK74YaooHUyrijxEmUy2XehAi2aoV8AZKo7wi/oke84vEG3Zc+4t6tnfujnnGhJTp6J2scMbA==",
"requires": {
"@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartlog-interfaces": "^2.0.2",
"@pushrocks/smartpromise": "^2.0.5",
"ora": "^3.0.0"
},
"dependencies": {
"ora": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-3.0.0.tgz",
"integrity": "sha512-LBS97LFe2RV6GJmXBi6OKcETKyklHNMV0xw7BtsVn2MlsgsydyZetSCbCANr+PFLmDyv4KV88nn0eCKza665Mg==",
"requires": {
"chalk": "^2.3.1",
"cli-cursor": "^2.1.0",
"cli-spinners": "^1.1.0",
"log-symbols": "^2.2.0",
"strip-ansi": "^4.0.0",
"wcwidth": "^1.0.1"
}
}
}
},
"@pushrocks/smartlog-interfaces": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.9.tgz",
"integrity": "sha512-0qwpomrRN0kFjmhR9m1iHYXoISoNuXtRP0Wr+JtkYyURLwKHMaW8Xoznf8MzXJptRfqufJi3Fxh5HodpPrIZUA=="
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.5.tgz",
"integrity": "sha512-eLNlRpDwy3E+6v/B6fo/NiAo+UxBO3SxKgIIsgUGbWfVpsyUi0PG2xfVCdhJlhL1AsRRvKglfHSOB8qKE+XCLw=="
},
"@pushrocks/smartparam": {
"version": "1.0.4",
@ -192,10 +230,31 @@
"form-data": "^2.3.2"
}
},
"@pushrocks/smartrx": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@pushrocks/smartrx/-/smartrx-2.0.2.tgz",
"integrity": "sha512-3lQONWp/Q/al8O6Cm9v6aSamNAzJimGHNFgHBKKmyBOVZaYrvhd6OMgDDicHE6vkYHXNtltXj5q3aIunz+bKwQ==",
"requires": {
"@pushrocks/lik": "^3.0.1",
"@pushrocks/smartpromise": "^2.0.5",
"rxjs": "^6.3.3",
"smartevent": "^1.0.1"
},
"dependencies": {
"rxjs": {
"version": "6.3.3",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz",
"integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"requires": {
"tslib": "^1.9.0"
}
}
}
},
"@pushrocks/smartshell": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@pushrocks/smartshell/-/smartshell-2.0.6.tgz",
"integrity": "sha512-D48KB3DDqLfMjOXGEutqJi+v3Z4RcWacu5BJXxUwrecvd6oetbKobfmNGxeHSQPmNGb7U3ISfKwV6c5T5EZkJg==",
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@pushrocks/smartshell/-/smartshell-2.0.8.tgz",
"integrity": "sha512-OeGrJez0vSHe/E0auHNUqf7r0B3yS+pkVe6BuxdJemJx5LBRtcHuZnJCxU5pSLL8igzlTfR+jVpjKJXUMzCsrA==",
"requires": {
"@pushrocks/smartpromise": "^2.0.5",
"@types/which": "^1.3.1",
@ -269,6 +328,16 @@
}
}
},
"@pushrocks/smarttime": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@pushrocks/smarttime/-/smarttime-3.0.5.tgz",
"integrity": "sha512-nHjJ8xRZ87OE8tBBIAOgjHJmJrc3MaPZtEZ5JDY2U9gjaED6JdRcdQ+vhSaLJT+U2u8YzXOuA6LfNN+X4jZm6A==",
"requires": {
"@pushrocks/smartpromise": "^2.0.5",
"@types/luxon": "^1.4.1",
"luxon": "^1.8.0"
}
},
"@pushrocks/tapbundle": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.7.tgz",
@ -363,9 +432,14 @@
}
},
"@types/lodash": {
"version": "4.14.116",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.116.tgz",
"integrity": "sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg=="
"version": "4.14.118",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz",
"integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw=="
},
"@types/luxon": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-1.4.1.tgz",
"integrity": "sha512-mYv/gbkOJ40CDgR8st5sosfFNrJncdlkpdzQSNRdU86UQg3oWWmll4AO/7B8F5FlBC6YrIXqXDSnkoCBqo+uMA=="
},
"@types/minimatch": {
"version": "3.0.3",
@ -373,9 +447,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
"version": "10.10.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.10.3.tgz",
"integrity": "sha512-dWk7F3b0m6uDLHero7tsnpAi9r2RGPQHGbb0/VCv7DPJRMFtk3RonY1/29vfJKnheRMBa7+uF+vunlg/mBGlxg=="
"version": "10.12.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.10.tgz",
"integrity": "sha512-8xZEYckCbUVgK8Eg7lf5Iy4COKJ5uXlnIOnePN0WUwSQggy9tolM+tDJf7wMOnT/JT/W9xDYIaYggt3mRV2O5w=="
},
"@types/shelljs": {
"version": "0.8.0",
@ -497,6 +571,59 @@
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"dev": true,
"requires": {
"chalk": "^1.1.3",
"esutils": "^2.0.2",
"js-tokens": "^3.0.2"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
},
"chalk": {
"version": "1.1.3",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
}
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
}
}
},
"backo2": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
@ -575,15 +702,21 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"callsite": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
"integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA="
},
"camelcase": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
"integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA=="
},
"cflare": {
"version": "1.0.5",
@ -718,6 +851,12 @@
"delayed-stream": "~1.0.0"
}
},
"commander": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
"dev": true
},
"component-bind": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
@ -782,12 +921,9 @@
}
},
"decamelize": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz",
"integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==",
"requires": {
"xregexp": "4.0.0"
}
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
"deep-eql": {
"version": "3.0.1",
@ -798,6 +934,21 @@
"type-detect": "^4.0.0"
}
},
"defaults": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
"requires": {
"clone": "^1.0.2"
},
"dependencies": {
"clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
}
}
},
"define-properties": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz",
@ -899,6 +1050,12 @@
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"execa": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz",
@ -1020,6 +1177,23 @@
"function-bind": "^1.1.1"
}
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
}
}
},
"has-binary2": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
@ -1150,6 +1324,12 @@
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.5.tgz",
"integrity": "sha512-aUnNwqMOXw3yvErjMPSQu6qIIzUmT1e5KcU1OZxRDU1g/am6mzBvcrmLAYwzmB59BHPrh5/tKaiF4OPhqRWESQ=="
},
"js-tokens": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
"js-yaml": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
@ -1237,6 +1417,11 @@
"chalk": "^2.0.1"
}
},
"luxon": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.8.0.tgz",
"integrity": "sha512-F742cYUYB7X+LXY3cIn6THZUBqRBjeAvF+CWE2i3+eKcv2bzsCsnRsBYL8Qrqzp1dfs6HsVcSjfKt2RcrtUElw=="
},
"make-error": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz",
@ -1244,9 +1429,9 @@
"dev": true
},
"map-age-cleaner": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz",
"integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==",
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
"requires": {
"p-defer": "^1.0.0"
}
@ -1294,13 +1479,13 @@
},
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
@ -1309,7 +1494,7 @@
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
@ -1373,6 +1558,15 @@
"requires": {
"@types/node": "*"
}
},
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
"integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
"requires": {
"readable-stream": "~2.3.6",
"xtend": "~4.0.1"
}
}
}
},
@ -1517,6 +1711,12 @@
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"dev": true
},
"pathval": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
@ -1587,6 +1787,15 @@
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
},
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
"integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
"path-parse": "^1.0.5"
}
},
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
@ -1610,9 +1819,9 @@
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"semver": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
"integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw=="
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
},
"set-blocking": {
"version": "2.0.0",
@ -1685,6 +1894,15 @@
"typings-global": "^1.0.14"
}
},
"smartevent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/smartevent/-/smartevent-1.0.1.tgz",
"integrity": "sha1-E9K/LPCU698XgT+g1GBB+BejAqo=",
"requires": {
"smartq": "^1.1.1",
"typings-global": "^1.0.16"
}
},
"smartlodash": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/smartlodash/-/smartlodash-1.0.1.tgz",
@ -1702,18 +1920,6 @@
}
}
},
"smartparam": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/smartparam/-/smartparam-1.0.2.tgz",
"integrity": "sha512-Q09m98X6+WG9q0Wpj6LXXSqGdYUItLAsj5ypJ8pRkGtry2V4zZzhimv4xviViLIfrgIBn5uTfbjNU0is7+WRTA==",
"requires": {
"beautylog": "6.1.10",
"is-promise": "^2.1.0",
"minimatch": "^3.0.4",
"smartq": "^1.1.6",
"typings-global": "^1.0.20"
}
},
"smartq": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/smartq/-/smartq-1.1.8.tgz",
@ -1912,11 +2118,11 @@
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
},
"through2": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
"integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz",
"integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==",
"requires": {
"readable-stream": "^2.1.5",
"readable-stream": "2 || 3",
"xtend": "~4.0.1"
}
},
@ -1951,6 +2157,41 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
},
"tslint": {
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz",
"integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.27.2"
}
},
"tslint-config-prettier": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.16.0.tgz",
"integrity": "sha512-zu6RAcpBtqdvhT6KpBh9kRPYATjOf9BnRi718kNqVKFjEgSE4rFrPprFju1YJrkOa3RbtbWI1ZSuLd2NBX1MDw==",
"dev": true
},
"tsutils": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
},
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@ -2017,6 +2258,14 @@
"vinyl": "^2.0.1"
}
},
"wcwidth": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
"integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
"requires": {
"defaults": "^1.0.3"
}
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
@ -2092,11 +2341,6 @@
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
"integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4="
},
"xregexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz",
"integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg=="
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
@ -2108,12 +2352,12 @@
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
},
"yargs": {
"version": "12.0.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz",
"integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==",
"version": "12.0.5",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
"integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
"requires": {
"cliui": "^4.0.0",
"decamelize": "^2.0.0",
"decamelize": "^1.2.0",
"find-up": "^3.0.0",
"get-caller-file": "^1.0.1",
"os-locale": "^3.0.0",
@ -2123,15 +2367,16 @@
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1 || ^4.0.0",
"yargs-parser": "^10.1.0"
"yargs-parser": "^11.1.1"
}
},
"yargs-parser": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
"integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
"version": "11.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
"integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
"requires": {
"camelcase": "^4.1.0"
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
},
"yeast": {

View File

@ -24,33 +24,36 @@
"homepage": "https://gitlab.com/gitzone/npmci#README",
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tsrun": "^1.1.13",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.10.3"
"@types/node": "^10.12.10",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0"
},
"dependencies": {
"@pushrocks/lik": "^3.0.1",
"@pushrocks/lik": "^3.0.2",
"@pushrocks/npmextra": "^3.0.1",
"@pushrocks/projectinfo": "^4.0.2",
"@pushrocks/smartcli": "^3.0.4",
"@pushrocks/smartcli": "^3.0.6",
"@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartfile": "^6.0.8",
"@pushrocks/smartfile": "^6.0.11",
"@pushrocks/smartlog": "^2.0.9",
"@pushrocks/smartlog-destination-local": "^7.0.5",
"@pushrocks/smartparam": "^1.0.4",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartrequest": "^1.1.14",
"@pushrocks/smartshell": "^2.0.6",
"@pushrocks/smartshell": "^2.0.8",
"@pushrocks/smartssh": "^1.2.3",
"@pushrocks/smartstring": "^3.0.4",
"@types/lodash": "^4.14.116",
"@types/lodash": "^4.14.118",
"@types/shelljs": "^0.8.0",
"@types/through2": "^2.0.34",
"beautylog": "^6.1.10",
"cflare": "^1.0.5",
"lodash": "^4.17.11",
"smartanalytics": "^2.0.9",
"smartsocket": "^1.1.19",
"through2": "^2.0.3"
"through2": "^3.0.0"
},
"private": false
}

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import * as paths from '../npmci.paths';
import { bash } from '../npmci.bash';
@ -10,7 +11,7 @@ import { DockerRegistry } from './mod.classes.dockerregistry';
import { RegistryStorage } from './mod.classes.registrystorage';
// instances
let npmciRegistryStorage = new RegistryStorage();
const npmciRegistryStorage = new RegistryStorage();
export { Dockerfile, helpers };
@ -23,7 +24,7 @@ export let modArgvArg; // will be set through the build command
export let handleCli = async argvArg => {
modArgvArg = argvArg;
if (argvArg._.length >= 2) {
let action: string = argvArg._[1];
const action: string = argvArg._[1];
switch (action) {
case 'build':
await build();
@ -42,10 +43,11 @@ export let handleCli = async argvArg => {
await pull(argvArg);
break;
default:
plugins.beautylog.error(`>>npmci docker ...<< action >>${action}<< not supported`);
logger.log('error', `>>npmci docker ...<< action >>${action}<< not supported`);
}
} else {
plugins.beautylog.log(
logger.log(
'info',
`>>npmci docker ...<< cli arguments invalid... Please read the documentation.`
);
}
@ -56,7 +58,7 @@ export let handleCli = async argvArg => {
*/
export let build = async () => {
await prepare();
plugins.beautylog.log('now building Dockerfiles...');
logger.log('info', 'now building Dockerfiles...');
await helpers
.readDockerfiles()
.then(helpers.sortDockerfiles)
@ -78,7 +80,7 @@ export let login = async () => {
export let prepare = async () => {
// Always login to GitLab Registry
if (!process.env.CI_BUILD_TOKEN || process.env.CI_BUILD_TOKEN === '') {
plugins.beautylog.error('No registry token specified by gitlab!');
logger.log('error', 'No registry token specified by gitlab!');
process.exit(1);
}
npmciRegistryStorage.addRegistry(
@ -98,40 +100,41 @@ export let prepare = async () => {
export let push = async argvArg => {
await prepare();
let registryUrlArg = argvArg._[2];
const registryUrlArg = argvArg._[2];
let suffix = null;
if (argvArg._.length >= 4) {
suffix = argvArg._[3];
}
let dockerfileArray = await helpers
const dockerfileArray = await helpers
.readDockerfiles()
.then(helpers.sortDockerfiles)
.then(helpers.mapDockerfiles);
let localDockerRegistry = npmciRegistryStorage.getRegistryByUrl(registryUrlArg);
const localDockerRegistry = npmciRegistryStorage.getRegistryByUrl(registryUrlArg);
if (!localDockerRegistry) {
plugins.beautylog.error(
logger.log(
'error',
`Cannot push to registry ${registryUrlArg}, because it was not found in the authenticated registry list.`
);
process.exit(1);
}
for (let dockerfile of dockerfileArray) {
for (const dockerfile of dockerfileArray) {
await dockerfile.push(localDockerRegistry, suffix);
}
};
export let pull = async argvArg => {
await prepare();
let registryUrlArg = argvArg._[2];
const registryUrlArg = argvArg._[2];
let suffix = null;
if (argvArg._.length >= 4) {
suffix = argvArg._[3];
}
let localDockerRegistry = npmciRegistryStorage.getRegistryByUrl(registryUrlArg);
let dockerfileArray = await helpers
const localDockerRegistry = npmciRegistryStorage.getRegistryByUrl(registryUrlArg);
const dockerfileArray = await helpers
.readDockerfiles()
.then(helpers.sortDockerfiles)
.then(helpers.mapDockerfiles);
for (let dockerfile of dockerfileArray) {
for (const dockerfile of dockerfileArray) {
await dockerfile.pull(localDockerRegistry, suffix);
}
};

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import * as NpmciEnv from '../npmci.env';
import { bash } from '../npmci.bash';
@ -10,16 +11,16 @@ import * as helpers from './mod.helpers';
* class Dockerfile represents a Dockerfile on disk in npmci
*/
export class Dockerfile {
filePath: string;
repo: string;
version: string;
cleanTag: string;
buildTag: string;
containerName: string;
content: string;
baseImage: string;
localBaseImageDependent: boolean;
localBaseDockerfile: Dockerfile;
public filePath: string;
public repo: string;
public version: string;
public cleanTag: string;
public buildTag: string;
public containerName: string;
public content: string;
public baseImage: string;
public localBaseImageDependent: boolean;
public localBaseDockerfile: Dockerfile;
constructor(options: { filePath?: string; fileContents?: string | Buffer; read?: boolean }) {
this.filePath = options.filePath;
this.repo = NpmciEnv.repo.user + '/' + NpmciEnv.repo.repo;
@ -38,10 +39,10 @@ export class Dockerfile {
/**
* builds the Dockerfile
*/
async build() {
plugins.beautylog.info('now building Dockerfile for ' + this.cleanTag);
let buildArgsString = await helpers.getDockerBuildArgs();
let buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
public async build() {
logger.log('info', 'now building Dockerfile for ' + this.cleanTag);
const buildArgsString = await helpers.getDockerBuildArgs();
const buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
await bash(buildCommand);
return;
}
@ -49,8 +50,8 @@ export class Dockerfile {
/**
* pushes the Dockerfile to a registry
*/
async push(dockerRegistryArg: DockerRegistry, versionSuffix: string = null) {
let pushTag = helpers.getDockerTagString(
public async push(dockerRegistryArg: DockerRegistry, versionSuffix: string = null) {
const pushTag = helpers.getDockerTagString(
dockerRegistryArg.registryUrl,
this.repo,
this.version,
@ -63,8 +64,8 @@ export class Dockerfile {
/**
* pulls the Dockerfile from a registry
*/
async pull(registryArg: DockerRegistry, versionSuffixArg: string = null) {
let pullTag = helpers.getDockerTagString(
public async pull(registryArg: DockerRegistry, versionSuffixArg: string = null) {
const pullTag = helpers.getDockerTagString(
registryArg.registryUrl,
this.repo,
this.version,
@ -77,9 +78,9 @@ export class Dockerfile {
/**
* tests the Dockerfile;
*/
async test() {
let testFile: string = plugins.path.join(paths.NpmciTestDir, 'test_' + this.version + '.sh');
let testFileExists: boolean = plugins.smartfile.fs.fileExistsSync(testFile);
public async test() {
const testFile: string = plugins.path.join(paths.NpmciTestDir, 'test_' + this.version + '.sh');
const testFileExists: boolean = plugins.smartfile.fs.fileExistsSync(testFile);
if (testFileExists) {
// run tests
await bash(
@ -93,17 +94,15 @@ export class Dockerfile {
await bash(`docker rm npmci_test_container`);
await bash(`docker rmi --force npmci_test_image`);
} else {
plugins.beautylog.warn(
'skipping tests for ' + this.cleanTag + ' because no testfile was found!'
);
logger.log('warn', 'skipping tests for ' + this.cleanTag + ' because no testfile was found!');
}
}
/**
* gets the id of a Dockerfile
*/
async getId() {
let containerId = await bash('docker inspect --type=image --format="{{.Id}}" ' + this.buildTag);
public async getId() {
const containerId = await bash('docker inspect --type=image --format="{{.Id}}" ' + this.buildTag);
return containerId;
}
}

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import { bash } from '../npmci.bash';
@ -8,26 +9,26 @@ export interface IDockerRegistryConstructorOptions {
}
export class DockerRegistry {
registryUrl: string;
username: string;
password: string;
public registryUrl: string;
public username: string;
public password: string;
constructor(optionsArg: IDockerRegistryConstructorOptions) {
this.registryUrl = optionsArg.registryUrl;
this.username = optionsArg.username;
this.password = optionsArg.password;
plugins.beautylog.info(`created DockerRegistry for ${this.registryUrl}`);
logger.log('info', `created DockerRegistry for ${this.registryUrl}`);
}
static fromEnvString(envString: string): DockerRegistry {
let dockerRegexResultArray = envString.split('|');
public static fromEnvString(envString: string): DockerRegistry {
const dockerRegexResultArray = envString.split('|');
if (dockerRegexResultArray.length !== 3) {
plugins.beautylog.error('malformed docker env var...');
logger.log('error', 'malformed docker env var...');
process.exit(1);
return;
}
let registryUrl = dockerRegexResultArray[0];
let username = dockerRegexResultArray[1];
let password = dockerRegexResultArray[2];
const registryUrl = dockerRegexResultArray[0];
const username = dockerRegexResultArray[1];
const password = dockerRegexResultArray[2];
return new DockerRegistry({
registryUrl: registryUrl,
username: username,
@ -35,13 +36,13 @@ export class DockerRegistry {
});
}
async login() {
public async login() {
if (this.registryUrl === 'docker.io') {
await bash(`docker login -u ${this.username} -p ${this.password}`);
plugins.beautylog.info('Logged in to standard docker hub');
logger.log('info', 'Logged in to standard docker hub');
} else {
await bash(`docker login -u ${this.username} -p ${this.password} ${this.registryUrl}`);
}
plugins.beautylog.ok(`docker authenticated for ${this.registryUrl}!`);
logger.log('ok', `docker authenticated for ${this.registryUrl}!`);
}
}

View File

@ -1,5 +1,6 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import { Objectmap } from 'lik';
import { Objectmap } from '@pushrocks/lik';
import { DockerRegistry } from './mod.classes.dockerregistry';
@ -23,6 +24,6 @@ export class RegistryStorage {
await this.objectMap.forEach(async registryArg => {
await registryArg.login();
});
plugins.beautylog.success('logged in successfully into all available DockerRegistries!');
logger.log('success', 'logged in successfully into all available DockerRegistries!');
}
}

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import * as paths from '../npmci.paths';
import * as NpmciEnv from '../npmci.env';
@ -11,14 +12,14 @@ import { Dockerfile } from './mod.classes.dockerfile';
* @returns Promise<Dockerfile[]>
*/
export let readDockerfiles = async (): Promise<Dockerfile[]> => {
let fileTree = await plugins.smartfile.fs.listFileTree(paths.cwd, 'Dockerfile*');
const fileTree = await plugins.smartfile.fs.listFileTree(paths.cwd, 'Dockerfile*');
// create the Dockerfile array
let readDockerfilesArray: Dockerfile[] = [];
plugins.beautylog.info(`found ${fileTree.length} Dockerfiles:`);
const readDockerfilesArray: Dockerfile[] = [];
logger.log('info', `found ${fileTree.length} Dockerfiles:`);
console.log(fileTree);
for (let dockerfilePath of fileTree) {
let myDockerfile = new Dockerfile({
for (const dockerfilePath of fileTree) {
const myDockerfile = new Dockerfile({
filePath: dockerfilePath,
read: true
});
@ -34,14 +35,14 @@ export let readDockerfiles = async (): Promise<Dockerfile[]> => {
* @returns Promise<Dockerfile[]>
*/
export let sortDockerfiles = (sortableArrayArg: Dockerfile[]): Promise<Dockerfile[]> => {
let done = plugins.smartpromise.defer<Dockerfile[]>();
plugins.beautylog.info('sorting Dockerfiles:');
let sortedArray: Dockerfile[] = [];
let cleanTagsOriginal = cleanTagsArrayFunction(sortableArrayArg, sortedArray);
const done = plugins.smartpromise.defer<Dockerfile[]>();
logger.log('info', 'sorting Dockerfiles:');
const sortedArray: Dockerfile[] = [];
const cleanTagsOriginal = cleanTagsArrayFunction(sortableArrayArg, sortedArray);
let sorterFunctionCounter: number = 0;
let sorterFunction = function() {
const sorterFunction = () => {
sortableArrayArg.forEach(dockerfileArg => {
let cleanTags = cleanTagsArrayFunction(sortableArrayArg, sortedArray);
const cleanTags = cleanTagsArrayFunction(sortableArrayArg, sortedArray);
if (
cleanTags.indexOf(dockerfileArg.baseImage) === -1 &&
sortedArray.indexOf(dockerfileArg) === -1
@ -54,8 +55,8 @@ export let sortDockerfiles = (sortableArrayArg: Dockerfile[]): Promise<Dockerfil
});
if (sortableArrayArg.length === sortedArray.length) {
let counter = 1;
for (let dockerfile of sortedArray) {
plugins.beautylog.log(`tag ${counter}: -> ${dockerfile.cleanTag}`);
for (const dockerfile of sortedArray) {
logger.log('info', `tag ${counter}: -> ${dockerfile.cleanTag}`);
counter++;
}
done.resolve(sortedArray);
@ -88,7 +89,7 @@ export let mapDockerfiles = async (sortedArray: Dockerfile[]): Promise<Dockerfil
* builds the correspoding real docker image for each Dockerfile class instance
*/
export let buildDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
for (let dockerfileArg of sortedArrayArg) {
for (const dockerfileArg of sortedArrayArg) {
await dockerfileArg.build();
}
return sortedArrayArg;
@ -99,7 +100,7 @@ export let buildDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
* @param sortedArrayArg Dockerfile[] that contains all Dockerfiles in cwd
*/
export let testDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
for (let dockerfileArg of sortedArrayArg) {
for (const dockerfileArg of sortedArrayArg) {
await dockerfileArg.test();
}
return sortedArrayArg;
@ -111,8 +112,8 @@ export let testDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
*/
export let dockerFileVersion = (dockerfileNameArg: string): string => {
let versionString: string;
let versionRegex = /Dockerfile_([a-zA-Z0-9\.]*)$/;
let regexResultArray = versionRegex.exec(dockerfileNameArg);
const versionRegex = /Dockerfile_([a-zA-Z0-9\.]*)$/;
const regexResultArray = versionRegex.exec(dockerfileNameArg);
if (regexResultArray && regexResultArray.length === 2) {
versionString = regexResultArray[1];
} else {
@ -124,9 +125,9 @@ export let dockerFileVersion = (dockerfileNameArg: string): string => {
/**
* returns the docker base image for a Dockerfile
*/
export let dockerBaseImage = function(dockerfileContentArg: string) {
let baseImageRegex = /FROM\s([a-zA-z0-9\/\-\:]*)\n?/;
let regexResultArray = baseImageRegex.exec(dockerfileContentArg);
export let dockerBaseImage = (dockerfileContentArg: string) => {
const baseImageRegex = /FROM\s([a-zA-z0-9\/\-\:]*)\n?/;
const regexResultArray = baseImageRegex.exec(dockerfileContentArg);
return regexResultArray[1];
};
@ -140,8 +141,8 @@ export let getDockerTagString = (
suffixArg?: string
): string => {
// determine wether the repo should be mapped accordingly to the registry
let mappedRepo = NpmciConfig.configObject.dockerRegistryRepoMap[registryArg];
let repo = (() => {
const mappedRepo = NpmciConfig.configObject.dockerRegistryRepoMap[registryArg];
const repo = (() => {
if (mappedRepo) {
return mappedRepo;
} else {
@ -155,15 +156,15 @@ export let getDockerTagString = (
version = versionArg + '_' + suffixArg;
}
let tagString = `${registryArg}/${repo}:${version}`;
const tagString = `${registryArg}/${repo}:${version}`;
return tagString;
};
export let getDockerBuildArgs = async (): Promise<string> => {
plugins.beautylog.info('checking for env vars to be supplied to the docker build');
logger.log('info', 'checking for env vars to be supplied to the docker build');
let buildArgsString: string = '';
for (let key in NpmciConfig.configObject.dockerBuildargEnvMap) {
let targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]];
for (const key in NpmciConfig.configObject.dockerBuildargEnvMap) {
const targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]];
buildArgsString = `${buildArgsString} --build-arg ${key}=${targetValue}`;
}
return buildArgsString;
@ -172,12 +173,12 @@ export let getDockerBuildArgs = async (): Promise<string> => {
/**
*
*/
export let cleanTagsArrayFunction = function(
export let cleanTagsArrayFunction = (
dockerfileArrayArg: Dockerfile[],
trackingArrayArg: Dockerfile[]
): string[] {
let cleanTagsArray: string[] = [];
dockerfileArrayArg.forEach(function(dockerfileArg) {
): string[] => {
const cleanTagsArray: string[] = [];
dockerfileArrayArg.forEach((dockerfileArg) => {
if (trackingArrayArg.indexOf(dockerfileArg) === -1) {
cleanTagsArray.push(dockerfileArg.cleanTag);
}

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import { bash } from '../npmci.bash';
import { repo } from '../npmci.env';
@ -8,38 +9,36 @@ import { repo } from '../npmci.env';
*/
export let handleCli = async argvArg => {
if (argvArg._.length >= 2) {
let action: string = argvArg._[1];
const action: string = argvArg._[1];
switch (action) {
case 'mirror':
await mirror();
break;
default:
plugins.beautylog.error(`>>npmci git ...<< action >>${action}<< not supported`);
logger.log('error', `>>npmci git ...<< action >>${action}<< not supported`);
}
} else {
plugins.beautylog.log(
`>>npmci git ...<< cli arguments invalid... Please read the documentation.`
);
logger.log('info', `>>npmci git ...<< cli arguments invalid... Please read the documentation.`);
}
};
export let mirror = async () => {
let githubToken = process.env.NPMCI_GIT_GITHUBTOKEN;
let githubUser = process.env.NPMCI_GIT_GITHUBGROUP || repo.user;
let githubRepo = process.env.NPMCI_GIT_GITHUB || repo.repo;
const githubToken = process.env.NPMCI_GIT_GITHUBTOKEN;
const githubUser = process.env.NPMCI_GIT_GITHUBGROUP || repo.user;
const githubRepo = process.env.NPMCI_GIT_GITHUB || repo.repo;
if (githubToken) {
plugins.beautylog.info('found github token.');
plugins.beautylog.log('attempting the mirror the repository to GitHub');
logger.log('info', 'found github token.');
logger.log('info', 'attempting the mirror the repository to GitHub');
// add the mirror
await bash(
`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`
);
await bash(`git push mirror --all`);
plugins.beautylog.ok('pushed all branches to mirror!');
logger.log('ok', 'pushed all branches to mirror!');
await bash(`git push mirror --tags`);
plugins.beautylog.ok('pushed all tags to mirror!');
logger.log('ok', 'pushed all tags to mirror!');
} else {
plugins.beautylog.error(`cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
process.exit(1);
}
};

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from '../npmci.plugins';
import * as paths from '../npmci.paths';
import * as npmciConfig from '../npmci.config';
@ -9,17 +10,18 @@ import { bash, bashNoError, nvmAvailable } from '../npmci.bash';
*/
export let handleCli = async argvArg => {
if (argvArg._.length >= 3) {
let action: string = argvArg._[1];
const action: string = argvArg._[1];
switch (action) {
case 'install':
await install(argvArg._[2]);
break;
default:
plugins.beautylog.error(`>>npmci node ...<< action >>${action}<< not supported`);
logger.log('error', `>>npmci node ...<< action >>${action}<< not supported`);
process.exit(1);
}
} else {
plugins.beautylog.error(
logger.log(
'error',
`>>npmci node ...<< cli arguments invalid... Please read the documentation.`
);
process.exit(1);
@ -31,7 +33,7 @@ export let handleCli = async argvArg => {
* @param versionArg
*/
export let install = async versionArg => {
plugins.beautylog.log(`now installing node version ${versionArg}`);
logger.log('info', `now installing node version ${versionArg}`);
let version: string;
if (versionArg === 'stable') {
version = '10';
@ -44,27 +46,27 @@ export let install = async versionArg => {
}
if (await nvmAvailable.promise) {
await bash(`nvm install ${version} && nvm alias default ${version}`);
plugins.beautylog.success(`Node version ${version} successfully installed!`);
logger.log('success', `Node version ${version} successfully installed!`);
} else {
plugins.beautylog.warn('Nvm not in path so staying at installed node version!');
logger.log('warn', 'Nvm not in path so staying at installed node version!');
}
await bash('node -v');
await bash('npm -v');
await bash(`npm config set cache ${paths.NpmciCacheDir} --global `);
// lets look for further config
await npmciConfig.getConfig().then(async configArg => {
plugins.beautylog.log('Now checking for needed global npm tools...');
for (let npmTool of configArg.npmGlobalTools) {
plugins.beautylog.info(`Checking for global "${npmTool}"`);
let whichOutput: string = await bashNoError(`which ${npmTool}`);
let toolAvailable: boolean = !(/not\sfound/.test(whichOutput) || whichOutput === '');
logger.log('info', 'Now checking for needed global npm tools...');
for (const npmTool of configArg.npmGlobalTools) {
logger.log('info', `Checking for global "${npmTool}"`);
const whichOutput: string = await bashNoError(`which ${npmTool}`);
const toolAvailable: boolean = !(/not\sfound/.test(whichOutput) || whichOutput === '');
if (toolAvailable) {
plugins.beautylog.log(`Tool ${npmTool} is available`);
logger.log('info', `Tool ${npmTool} is available`);
} else {
plugins.beautylog.info(`globally installing ${npmTool} from npm`);
logger.log('info', `globally installing ${npmTool} from npm`);
await bash(`npm install ${npmTool} -q -g`);
}
}
plugins.beautylog.success('all global npm tools specified in npmextra.json are now available!');
logger.log('success', 'all global npm tools specified in npmextra.json are now available!');
});
};

View File

@ -1,3 +1,4 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
import * as configModule from '../npmci.config';
import { bash, bashNoError, nvmAvailable } from '../npmci.bash';
@ -8,7 +9,7 @@ import { bash, bashNoError, nvmAvailable } from '../npmci.bash';
*/
export let handleCli = async argvArg => {
if (argvArg._.length >= 2) {
let action: string = argvArg._[1];
const action: string = argvArg._[1];
switch (action) {
case 'install':
await install();
@ -23,13 +24,11 @@ export let handleCli = async argvArg => {
await publish();
break;
default:
plugins.beautylog.error(`>>npmci npm ...<< action >>${action}<< not supported`);
logger.log('error', `>>npmci npm ...<< action >>${action}<< not supported`);
process.exit(1);
}
} else {
plugins.beautylog.log(
`>>npmci npm ...<< cli arguments invalid... Please read the documentation.`
);
logger.log('info', `>>npmci npm ...<< cli arguments invalid... Please read the documentation.`);
process.exit(1);
}
};
@ -37,14 +36,14 @@ export let handleCli = async argvArg => {
/**
* authenticates npm with token from env var
*/
let prepare = async () => {
let npmrcPrefix: string = '//registry.npmjs.org/:_authToken=';
let npmToken: string = process.env.NPMCI_TOKEN_NPM;
let npmrcFileString: string = npmrcPrefix + npmToken;
const prepare = async () => {
const npmrcPrefix: string = '//registry.npmjs.org/:_authToken=';
const npmToken: string = process.env.NPMCI_TOKEN_NPM;
const npmrcFileString: string = npmrcPrefix + npmToken;
if (npmToken) {
plugins.beautylog.info('found access token');
logger.log('info', 'found access token');
} else {
plugins.beautylog.error('no access token found! Exiting!');
logger.log('error', 'no access token found! Exiting!');
process.exit(1);
}
plugins.smartfile.memory.toFsSync(npmrcFileString, '/root/.npmrc');
@ -54,7 +53,7 @@ let prepare = async () => {
/**
* publish a package to npm
*/
let publish = async () => {
const publish = async () => {
let npmAccessCliString = ``;
const config = await configModule.getConfig();
@ -67,7 +66,7 @@ let publish = async () => {
}
// -> preparing
plugins.beautylog.log(`now preparing environment:`);
logger.log('info', `now preparing environment:`);
prepare();
await bash(`npm -v`);
@ -75,26 +74,26 @@ let publish = async () => {
await bash(`npm install`);
await bash(`npm run build`);
plugins.beautylog.success(`Nice!!! The build for the publication was successfull!`);
plugins.beautylog.log(`Lets clean up so we don't publish any packages that don't belong to us:`);
logger.log('success', `Nice!!! The build for the publication was successfull!`);
logger.log('info', `Lets clean up so we don't publish any packages that don't belong to us:`);
// -> clean up before we publish stuff
await bashNoError(`rm -r ./.npmci_cache`);
await bash(`rm -r ./node_modules`);
plugins.beautylog.success(`Cleaned up!:`);
logger.log('success', `Cleaned up!:`);
// -> publish it
plugins.beautylog.log(`now invoking npm to publish the package!`);
logger.log('info', `now invoking npm to publish the package!`);
await bash(`npm publish ${npmAccessCliString}`);
plugins.beautylog.success(`Package was successfully published!`);
logger.log('success', `Package was successfully published!`);
};
let install = async (): Promise<void> => {
plugins.beautylog.info('now installing dependencies:');
const install = async (): Promise<void> => {
logger.log('info', 'now installing dependencies:');
await bash('npm install');
};
export let test = async (): Promise<void> => {
plugins.beautylog.info('now starting tests:');
logger.log('info', 'now starting tests:');
await bash('npm test');
};

View File

@ -1,19 +1,20 @@
import { logger } from '../npmci.logging';
import * as plugins from './mod.plugins';
let sshInstance: plugins.smartssh.SshInstance;
export let handleCli = async argvArg => {
if (argvArg._.length >= 2) {
let action: string = argvArg._[1];
const action: string = argvArg._[1];
switch (action) {
case 'prepare':
await prepare();
break;
default:
plugins.beautylog.error(`action >>${action}<< not supported`);
logger.log('error', `action >>${action}<< not supported`);
process.exit(1);
}
} else {
plugins.beautylog.error(`>>npmci ssh ...<< please specify an action!`);
logger.log('error', `>>npmci ssh ...<< please specify an action!`);
process.exit(1);
}
};
@ -21,7 +22,7 @@ export let handleCli = async argvArg => {
/**
* checks if not undefined
*/
let notUndefined = (stringArg: string) => {
const notUndefined = (stringArg: string) => {
return stringArg && stringArg !== 'undefined' && stringArg !== '##';
};
@ -34,27 +35,27 @@ export let prepare = async () => {
if (!process.env.NPMTS_TEST) {
sshInstance.writeToDisk();
} else {
plugins.beautylog.log('In test mode, so not storing SSH keys to disk!');
logger.log('info', 'In test mode, so not storing SSH keys to disk!');
}
};
/**
* gets called for each found SSH ENV Var and deploys it
*/
let evaluateSshEnv = async (sshkeyEnvVarArg: string) => {
let sshEnvArray = sshkeyEnvVarArg.split('|');
let sshKey = new plugins.smartssh.SshKey();
plugins.beautylog.info('Found SSH identity for ' + sshEnvArray[1]);
const evaluateSshEnv = async (sshkeyEnvVarArg: string) => {
const sshEnvArray = sshkeyEnvVarArg.split('|');
const sshKey = new plugins.smartssh.SshKey();
logger.log('info', 'Found SSH identity for ' + sshEnvArray[1]);
if (notUndefined(sshEnvArray[0])) {
plugins.beautylog.log('---> host defined!');
logger.log('info', '---> host defined!');
sshKey.host = sshEnvArray[0];
}
if (notUndefined(sshEnvArray[1])) {
plugins.beautylog.log('---> privKey defined!');
logger.log('info', '---> privKey defined!');
sshKey.privKeyBase64 = sshEnvArray[1];
}
if (notUndefined(sshEnvArray[2])) {
plugins.beautylog.log('---> pubKey defined!');
logger.log('info', '---> pubKey defined!');
sshKey.pubKeyBase64 = sshEnvArray[2];
}

View File

@ -1,28 +1,29 @@
import * as plugins from './mod.plugins';
import { bash } from '../npmci.bash';
import { logger } from '../npmci.logging';
let triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
const triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
export let trigger = async () => {
plugins.beautylog.info('now running triggers');
logger.log('info', 'now running triggers');
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TRIGGER_*', evaluateTrigger);
};
let evaluateTrigger = async triggerEnvVarArg => {
let triggerRegexResultArray = triggerValueRegex.exec(triggerEnvVarArg);
let regexDomain = triggerRegexResultArray[1];
let regexProjectId = triggerRegexResultArray[2];
let regexProjectTriggerToken = triggerRegexResultArray[3];
let regexRefName = triggerRegexResultArray[4];
const evaluateTrigger = async triggerEnvVarArg => {
const triggerRegexResultArray = triggerValueRegex.exec(triggerEnvVarArg);
const regexDomain = triggerRegexResultArray[1];
const regexProjectId = triggerRegexResultArray[2];
const regexProjectTriggerToken = triggerRegexResultArray[3];
const regexRefName = triggerRegexResultArray[4];
let regexTriggerName;
if (triggerRegexResultArray.length === 6) {
regexTriggerName = triggerRegexResultArray[5];
} else {
regexTriggerName = 'Unnamed Trigger';
}
plugins.beautylog.info('Found Trigger!');
plugins.beautylog.log('triggering build for ref ' + regexRefName + ' of ' + regexTriggerName);
plugins.request.postFormData(
logger.log('info', 'Found Trigger!');
logger.log('info', 'triggering build for ref ' + regexRefName + ' of ' + regexTriggerName);
plugins.smartrequest.postFormData(
'https://gitlab.com/api/v3/projects/' + regexProjectId + '/trigger/builds',
{},
[

View File

@ -1,3 +1,4 @@
import { logger } from './npmci.logging';
import * as plugins from './npmci.plugins';
import * as paths from './npmci.paths';
@ -10,7 +11,7 @@ export let nvmAvailable = smartpromise.defer<boolean>();
/**
* the smartshell instance for npmci
*/
let npmciSmartshell = new plugins.smartshell.Smartshell({
const npmciSmartshell = new plugins.smartshell.Smartshell({
executor: 'bash',
sourceFilePaths: []
});
@ -18,7 +19,7 @@ let npmciSmartshell = new plugins.smartshell.Smartshell({
/**
* check for tools.
*/
let checkToolsAvailable = async () => {
const checkToolsAvailable = async () => {
// check for nvm
if (!process.env.NPMTS_TEST) {
if (
@ -68,21 +69,19 @@ export let bash = async (commandArg: string, retryArg: number = 2): Promise<stri
if (execResult.exitCode !== 0 && i === retryArg) {
// something went wrong and retries are exhausted
if (failOnError) {
plugins.beautylog.error('something went wrong and retries are exhausted');
logger.log('error', 'something went wrong and retries are exhausted');
process.exit(1);
}
} else if (execResult.exitCode === 0) {
// everything went fine, or no error wanted
i = retryArg + 1; // retry +1 breaks for loop, if everything works out ok retrials are not wanted
} else {
plugins.beautylog.warn(
'Something went wrong! Exit Code: ' + execResult.exitCode.toString()
);
plugins.beautylog.info('Retry ' + (i + 1).toString() + ' of ' + retryArg.toString());
logger.log('warn', 'Something went wrong! Exit Code: ' + execResult.exitCode.toString());
logger.log('info', 'Retry ' + (i + 1).toString() + ' of ' + retryArg.toString());
}
}
} else {
plugins.beautylog.log('ShellExec would be: ' + commandArg);
logger.log('info', 'ShellExec would be: ' + commandArg);
execResult = {
exitCode: 0,
stdout: 'testOutput'

View File

@ -1,11 +1,12 @@
import { logger } from './npmci.logging';
import * as plugins from './npmci.plugins';
import * as paths from './npmci.paths';
import * as npmciMonitor from './npmci.monitor';
npmciMonitor.run();
// Get Info about npmci itself
let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
plugins.beautylog.log('npmci version: ' + npmciInfo.version);
const npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
logger.log('info', 'npmci version: ' + npmciInfo.version);
import * as NpmciEnv from './npmci.env';
@ -15,7 +16,7 @@ npmciSmartcli.addVersion(npmciInfo.version);
// clean
npmciSmartcli.addCommand('clean').subscribe(
async argv => {
let modClean = await import('./mod_clean/index');
const modClean = await import('./mod_clean/index');
await modClean.clean();
},
err => {
@ -27,7 +28,7 @@ npmciSmartcli.addCommand('clean').subscribe(
// command
npmciSmartcli.addCommand('command').subscribe(
async argv => {
let modCommand = await import('./mod_command/index');
const modCommand = await import('./mod_command/index');
await modCommand.command();
},
err => {
@ -39,7 +40,7 @@ npmciSmartcli.addCommand('command').subscribe(
// command
npmciSmartcli.addCommand('git').subscribe(
async argvArg => {
let modGit = await import('./mod_git/index');
const modGit = await import('./mod_git/index');
await modGit.handleCli(argvArg);
},
err => {
@ -51,7 +52,7 @@ npmciSmartcli.addCommand('git').subscribe(
// build
npmciSmartcli.addCommand('docker').subscribe(
async argvArg => {
let modDocker = await import('./mod_docker/index');
const modDocker = await import('./mod_docker/index');
await modDocker.handleCli(argvArg);
},
err => {
@ -63,7 +64,7 @@ npmciSmartcli.addCommand('docker').subscribe(
// node
npmciSmartcli.addCommand('node').subscribe(
async argvArg => {
let modNode = await import('./mod_node/index');
const modNode = await import('./mod_node/index');
await modNode.handleCli(argvArg);
},
err => {
@ -75,7 +76,7 @@ npmciSmartcli.addCommand('node').subscribe(
// npm
npmciSmartcli.addCommand('npm').subscribe(
async argvArg => {
let modNpm = await import('./mod_npm/index');
const modNpm = await import('./mod_npm/index');
await modNpm.handleCli(argvArg);
},
err => {
@ -86,7 +87,7 @@ npmciSmartcli.addCommand('npm').subscribe(
// trigger
npmciSmartcli.addCommand('ssh').subscribe(
async argvArg => {
let modSsh = await import('./mod_ssh/index');
const modSsh = await import('./mod_ssh/index');
await modSsh.handleCli(argvArg);
},
err => {
@ -98,7 +99,7 @@ npmciSmartcli.addCommand('ssh').subscribe(
// trigger
npmciSmartcli.addCommand('trigger').subscribe(
async argv => {
let modTrigger = await import('./mod_trigger/index');
const modTrigger = await import('./mod_trigger/index');
await modTrigger.trigger();
},
err => {

View File

@ -1,5 +1,3 @@
import * as q from 'q';
import * as plugins from './npmci.plugins';
import * as paths from './npmci.paths';
@ -18,8 +16,8 @@ export interface INpmciOptions {
export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`);
// handle config retrival
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
let defaultConfig: INpmciOptions = {
const npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
const defaultConfig: INpmciOptions = {
npmGlobalTools: [],
dockerRegistryRepoMap: {},
dockerBuildargEnvMap: {}

14
ts/npmci.logging.ts Normal file
View File

@ -0,0 +1,14 @@
import * as plugins from './npmci.plugins';
export const logger = new plugins.smartlog.Smartlog({
logContext: {
company: 'Some Company',
companyunit: 'Some Unit',
containerName: 'Some ContainerName',
environment: 'test',
runtime: 'node',
zone: 'Some Zone'
}
});
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());

View File

@ -1,3 +1,4 @@
import { logger } from './npmci.logging';
import * as plugins from './npmci.plugins';
import * as env from './npmci.env';
@ -17,6 +18,6 @@ export let run = async () => {
repo: env.repo.repo
})
.catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...');
logger.log('warn', 'Lossless Analytics API not available...');
});
};

View File

@ -1,21 +1,43 @@
// node native
export import path = require('path');
import * as path from 'path';
export { path };
// @pushrocks
export import beautylog = require('beautylog');
export import projectinfo = require('@pushrocks/projectinfo');
export import npmextra = require('@pushrocks/npmextra');
export import smartdelay = require('@pushrocks/smartdelay');
export import smartfile = require('@pushrocks/smartfile');
export import smartcli = require('@pushrocks/smartcli');
export import smartparam = require('smartparam');
export import smartpromise = require('@pushrocks/smartpromise');
export import smartshell = require('@pushrocks/smartshell');
export import smartsocket = require('smartsocket');
export import smartssh = require('@pushrocks/smartssh');
export import smartstring = require('@pushrocks/smartstring');
import * as projectinfo from '@pushrocks/projectinfo';
import * as npmextra from '@pushrocks/npmextra';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartfile from '@pushrocks/smartfile';
import * as smartcli from '@pushrocks/smartcli';
import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartparam from '@pushrocks/smartparam';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest';
import * as smartshell from '@pushrocks/smartshell';
import * as smartsocket from 'smartsocket';
import * as smartssh from '@pushrocks/smartssh';
import * as smartstring from '@pushrocks/smartstring';
export {
projectinfo,
npmextra,
smartdelay,
smartfile,
smartcli,
smartlog,
smartlogDestinationLocal,
smartparam,
smartpromise,
smartrequest,
smartshell,
smartsocket,
smartssh,
smartstring
};
// third party
export import lodash = require('lodash');
export import through2 = require('through2');
export import request = require('@pushrocks/smartrequest');
import * as lodash from 'lodash';
import * as through2 from 'through2';
export { lodash, through2 };

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}