From f75151d6c6bfdcd40f9ccc1e1fe48429f7e787b4 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 17 Jul 2020 14:56:24 +0100 Subject: [PATCH] move scripts check env in cli (#5889) * move scripts check env in cli * rmeove logs dep * move scripts check env in cli * build all --- lib/cli/README.md | 2 + lib/cli/package-lock.json | 268 +++++++++++++----- lib/cli/package.json | 2 +- .../cli/scripts/check-cs-env.ts | 14 +- .../cli/scripts/check-ps-env.ts | 14 +- lib/cli/scripts/logger.ts | 40 +-- scripts/check-env/delete-all-apps.js | 125 -------- scripts/travis/build/build.sh | 7 +- scripts/travis/e2e/content-services-e2e.sh | 2 +- scripts/travis/e2e/core-e2e.sh | 4 +- scripts/travis/e2e/insights-e2e.sh | 2 +- .../travis/e2e/process-services-cloud-e2e.sh | 2 +- scripts/travis/e2e/process-services-e2e.sh | 2 +- scripts/travis/e2e/search-e2e.sh | 2 +- 14 files changed, 233 insertions(+), 253 deletions(-) rename scripts/check-env/check-cs-env.js => lib/cli/scripts/check-cs-env.ts (91%) rename scripts/check-env/check-ps-env.js => lib/cli/scripts/check-ps-env.ts (79%) delete mode 100755 scripts/check-env/delete-all-apps.js diff --git a/lib/cli/README.md b/lib/cli/README.md index 99317a998c..67e7c75dc2 100644 --- a/lib/cli/README.md +++ b/lib/cli/README.md @@ -42,6 +42,8 @@ In develop mode, the CLI takes the prebuilt scripts from the dist folder. | **Commands** |**Description** | |--- |--- | +|check-cs-env |Check cs env is up | +|check-ps-env |Check ps env is up | |artifact-from-s3 |Get artifact from S3 | |artifact-to-s3 |Get artifact to S3 | |docker-publish |publish docker image| diff --git a/lib/cli/package-lock.json b/lib/cli/package-lock.json index b3fb8045c7..8deb39f4f5 100644 --- a/lib/cli/package-lock.json +++ b/lib/cli/package-lock.json @@ -4,26 +4,14 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@angular-devkit/core": { - "version": "9.1.7", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-9.1.7.tgz", - "integrity": "sha512-guvolu9Cl+qYMTtedLZD9wCqustJjdqzJ2psD2C1Sr1LrX9T0mprmDldR/YnhsitThveJEb6sM/0EvqWxoSvKw==", + "@alfresco/js-api": { + "version": "3.10.0-c1ad5d79a257f31a52ffd327022458da7926c211", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-3.10.0-c1ad5d79a257f31a52ffd327022458da7926c211.tgz", + "integrity": "sha512-uGwCzNddEJYv9ZDME4cLqxc7Vam6CqK9ueMSz7pacIT1wHqoc5Y5XnON0zziL5msvRxVq1WMKu76QrF53OmJ3w==", "requires": { - "ajv": "6.12.0", - "fast-json-stable-stringify": "2.1.0", - "magic-string": "0.25.7", - "rxjs": "6.5.4", - "source-map": "0.7.3" - }, - "dependencies": { - "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", - "requires": { - "tslib": "^1.9.0" - } - } + "event-emitter": "^0.3.5", + "minimatch": "3.0.4", + "superagent": "^5.1.2" } }, "@types/events": { @@ -95,17 +83,6 @@ "humanize-ms": "^1.2.1" } }, - "ajv": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", - "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -129,6 +106,11 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -208,11 +190,24 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -229,6 +224,11 @@ "typedarray": "^0.0.6" } }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -252,6 +252,15 @@ "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -265,6 +274,11 @@ "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=" }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, "dezalgo": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", @@ -311,6 +325,26 @@ "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=" }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -324,20 +358,48 @@ "es6-promise": "^4.0.3" } }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } + } + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, "figgy-pudding": { "version": "3.5.2", @@ -353,6 +415,21 @@ "readable-stream": "^2.3.6" } }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" + }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -509,11 +586,6 @@ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -544,14 +616,6 @@ "yallist": "^3.0.2" } }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, "make-fetch-happen": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", @@ -570,6 +634,29 @@ "ssri": "^6.0.0" } }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "requires": { + "mime-db": "1.44.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -626,6 +713,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, "node-fetch-npm": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", @@ -782,10 +874,10 @@ } } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" }, "read-installed": { "version": "4.0.3", @@ -953,16 +1045,6 @@ } } }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, "spdx-compare": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", @@ -1058,6 +1140,49 @@ } } }, + "superagent": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.3.1.tgz", + "integrity": "sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==", + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.1", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", + "formidable": "^1.2.2", + "methods": "^1.1.2", + "mime": "^2.4.6", + "qs": "^6.9.4", + "readable-stream": "^3.6.0", + "semver": "^7.3.2" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" + } + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1090,6 +1215,11 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -1117,14 +1247,6 @@ "imurmurhash": "^0.1.4" } }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/lib/cli/package.json b/lib/cli/package.json index 1762ae7266..c656dc2fca 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -20,10 +20,10 @@ "dist": "rm -rf ./dist/ && npm run build && cp -R ./bin ./dist/ && cp -R ./templates ./dist && cp ./package.json ./dist/" }, "dependencies": { + "@alfresco/js-api": "3.10.0-c1ad5d79a257f31a52ffd327022458da7926c211", "commander": "^4.0.0", "license-checker": "^25.0.1", "npm-registry-fetch": "^4.0.5", - "@angular-devkit/core": "^9.1.7", "rxjs": "^6.5.5", "shelljs": "^0.8.3", "spdx-license-list": "^5.0.0", diff --git a/scripts/check-env/check-cs-env.js b/lib/cli/scripts/check-cs-env.ts similarity index 91% rename from scripts/check-env/check-cs-env.js rename to lib/cli/scripts/check-cs-env.ts index 3d8aeab8d2..595de82a63 100755 --- a/scripts/check-env/check-cs-env.js +++ b/lib/cli/scripts/check-cs-env.ts @@ -1,16 +1,18 @@ -let alfrescoApi = require('@alfresco/js-api'); -let program = require('commander'); +const alfrescoApi = require('@alfresco/js-api'); +const program = require('commander'); const path = require('path'); const fs = require('fs'); -let MAX_RETRY = 10; +const MAX_RETRY = 10; +const TIMEOUT = 60000; let counter = 0; -let TIMEOUT = 60000; -async function main() { +export default async function main(_args: string[]) { program .version('0.1.0') + .description('Check Content service is up ') + .usage('check-cs-env [options]') .option('--host [type]', 'Remote environment host adf.lab.com ') .option('-p, --password [type]', 'password ') .option('-u, --username [type]', 'username ') @@ -112,5 +114,3 @@ function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay) ; } - -main(); diff --git a/scripts/check-env/check-ps-env.js b/lib/cli/scripts/check-ps-env.ts similarity index 79% rename from scripts/check-env/check-ps-env.js rename to lib/cli/scripts/check-ps-env.ts index 0bf5e8106e..c578d92406 100755 --- a/scripts/check-env/check-ps-env.js +++ b/lib/cli/scripts/check-ps-env.ts @@ -1,14 +1,16 @@ -let alfrescoApi = require('@alfresco/js-api'); -let program = require('commander'); +const alfrescoApi = require('@alfresco/js-api'); +const program = require('commander'); -let MAX_RETRY = 10; +const MAX_RETRY = 10; +const TIMEOUT = 60000; let counter = 0; -let TIMEOUT = 60000; -async function main() { +export default async function main(_args: string[]) { program .version('0.1.0') + .description('Check Process service is up ') + .usage('check-ps-env [options]') .option('--host [type]', 'Remote environment host adf.lab.com ') .option('-p, --password [type]', 'password ') .option('-u, --username [type]', 'username ') @@ -46,5 +48,3 @@ function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay) ; } - -main(); diff --git a/lib/cli/scripts/logger.ts b/lib/cli/scripts/logger.ts index 47064c68a6..7e1872ea1b 100644 --- a/lib/cli/scripts/logger.ts +++ b/lib/cli/scripts/logger.ts @@ -17,36 +17,18 @@ /* tslint:disable */ let log = null; -try { - log = new (require('@angular-devkit/core').logging.IndentLogger)('root'); - const { bold, gray, red, yellow, white } = require('@angular-devkit/core').terminal; - const filter = require('rxjs/operators').filter; - log - .pipe(filter(entry => (entry.level !== 'debug'))) - .subscribe(entry => { - let color = gray; - let output = process.stdout; - switch (entry.level) { - case 'info': color = white; break; - case 'warn': color = yellow; break; - case 'error': color = red; output = process.stderr; break; - case 'fatal': color = x => bold(red(x)); output = process.stderr; break; - } - - output.write(color(entry.message) + '\n'); - }); -} catch (e) { - console.error(`Reverting to manual console logging.\nReason: ${e.message}.`); - log = { - debug: console.log.bind(console), - info: console.log.bind(console), - warn: console.warn.bind(console), - error: console.error.bind(console), - fatal: x => { console.error(x); process.exit(100); }, - createChild: () => log - }; -} +log = { + debug: console.log.bind(console), + info: console.log.bind(console), + warn: console.warn.bind(console), + error: console.error.bind(console), + fatal: x => { + console.error(x); + process.exit(100); + }, + createChild: () => log +}; export let logger = log; /* tslint:enable */ diff --git a/scripts/check-env/delete-all-apps.js b/scripts/check-env/delete-all-apps.js deleted file mode 100755 index 5bc0241dfc..0000000000 --- a/scripts/check-env/delete-all-apps.js +++ /dev/null @@ -1,125 +0,0 @@ -let alfrescoApi = require('@alfresco/js-api'); -let program = require('commander'); -const RESOURCES_CLOUD = require("@alfresco/adf-process-services-cloud"); - -let config = {}; -let absentApps = []; -let notRunningApps = []; -let host; - -async function main() { - - program - .version('0.1.0') - .option('--host [type]', 'Remote environment host adf.lab.com ') - .option('--client [type]', 'clientId ') - .option('-p, --password [type]', 'password ') - .option('-u, --username [type]', 'username ') - .parse(process.argv); - - config = { - provider: 'BPM', - hostBpm: `http://${program.host}`, - authType: 'OAUTH', - oauth2: { - host: `http://${program.host}/auth/realms/alfresco`, - clientId: program.client, - scope: 'openid', - secret: '', - implicitFlow: false, - silentLogin: false, - redirectUri: '/', - redirectUriLogout: '/logout' - } - }; - - host = program.host; - - let alfrescoJsApi; - - try { - alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility(config); - await alfrescoJsApi.login(program.username, program.password); - } catch (e) { - console.log('Login error' + e); - return; - } - - for (const key of Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS)) { - await deleteApp(alfrescoJsApi, RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name); - } - - let notRunning = await getNotRunningApps(alfrescoJsApi); - - if (notRunning && notRunning.length > 0) { - console.log(JSON.stringify(notRunning)); - } -} - -async function getNotRunningApps(alfrescoJsApi) { - let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, ''); - - Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS).forEach((key) => { - let isNotRunning = allStatusApps.find((currentApp) => { - //console.log(currentApp.entry.name + ' ' +currentApp.entry.status); - return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running'; - }); - - if (isNotRunning && isNotRunning.entry.status !== 'ImagePushFailed') { - notRunningApps.push(isNotRunning); - } - }); - - if (notRunningApps.length > 0) { - console.log(`The following apps are NOT running in the target env:`); - notRunningApps.forEach((currentApp) => { - console.log(`App ${currentApp.entry.name } current status ${JSON.stringify(currentApp.entry.status)}`); - }); - - await checkIfAppIsReleased(alfrescoJsApi, absentApps); - } - - return notRunningApps; -} - -async function getDeployedApplicationsByStatus(apiService, status) { - const url = `${config.hostBpm}/alfresco-deployment-service/v1/applications`; - - const pathParams = {}, queryParams = {status: status}, - headerParams = {}, formParams = {}, bodyParam = {}, - contentTypes = ['application/json'], accepts = ['application/json']; - - let data; - try { - data = await apiService.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam, - contentTypes, accepts); - - return data.list.entries; - } catch (error) { - console.log(`Not possible get the applications from alfresco-deployment-service ${JSON.stringify(error)} `); - process.exit(1); - } - -} - -async function deleteApp(apiService, appName) { - console.log(`Delete the app ${appName}`); - - const url = `${config.hostBpm}/alfresco-deployment-service/v1/applications/${appName}`; - - const pathParams = {}, queryParams = {}, - headerParams = {}, formParams = {}, bodyParam = {}, - contentTypes = ['application/json'], accepts = ['application/json']; - - try { - await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, - contentTypes, accepts); - - console.log(`App deleted`); - } catch (error) { - console.log(`Not possible to delete the application from alfresco-modeling-service` + error); - process.exit(1); - } -} - -main(); diff --git a/scripts/travis/build/build.sh b/scripts/travis/build/build.sh index e11c50820f..40586e6cb8 100755 --- a/scripts/travis/build/build.sh +++ b/scripts/travis/build/build.sh @@ -23,15 +23,14 @@ then node ./scripts/pre-publish.js npm install - - ./scripts/build/build-all-lib.sh - else echo "====== Update the package.json with latest JS-API/CLI deps =====" npx @alfresco/adf-cli@alpha update-version --alpha --pathPackage "$(pwd)" npm install; - nx affected --target=build --base=$BASE_HASH --head=$HEAD_HASH --exclude="cli,demoshell" --prod --with-deps || exit 1; +# nx affected --target=build --base=$BASE_HASH --head=$HEAD_HASH --exclude="cli,demoshell" --prod --with-deps || exit 1; TODO comment out when affected is fixe fi; +./scripts/build/build-all-lib.sh + echo "====== Build Demo shell for production =====" nx build demoshell --prod diff --git a/scripts/travis/e2e/content-services-e2e.sh b/scripts/travis/e2e/content-services-e2e.sh index 16914cebc3..f3c92dcef4 100755 --- a/scripts/travis/e2e/content-services-e2e.sh +++ b/scripts/travis/e2e/content-services-e2e.sh @@ -15,7 +15,7 @@ if [[ $TRAVIS_PULL_REQUEST == "true" ]]; then AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")"; fi; -node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 #-b is needed to run the Folder upload test that are not workin in Headless chrome RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -save -m 4 || exit 1) diff --git a/scripts/travis/e2e/core-e2e.sh b/scripts/travis/e2e/core-e2e.sh index 7f80f410cf..0ae8908ef8 100755 --- a/scripts/travis/e2e/core-e2e.sh +++ b/scripts/travis/e2e/core-e2e.sh @@ -14,8 +14,8 @@ if [[ $TRAVIS_PULL_REQUEST == "true" ]]; then AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")"; fi; -node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 -node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -m 2 || exit 1) if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]]; diff --git a/scripts/travis/e2e/insights-e2e.sh b/scripts/travis/e2e/insights-e2e.sh index e9502f1bd6..ed66759001 100755 --- a/scripts/travis/e2e/insights-e2e.sh +++ b/scripts/travis/e2e/insights-e2e.sh @@ -14,6 +14,6 @@ fi; if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "insight" || $TRAVIS_PULL_REQUEST == "false" ]]; then - node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1; + ./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1; ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --use-dist || exit 1; fi; diff --git a/scripts/travis/e2e/process-services-cloud-e2e.sh b/scripts/travis/e2e/process-services-cloud-e2e.sh index d608824d0e..9a552acd9b 100755 --- a/scripts/travis/e2e/process-services-cloud-e2e.sh +++ b/scripts/travis/e2e/process-services-cloud-e2e.sh @@ -19,7 +19,7 @@ RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2 check_env(){ ./node_modules/@alfresco/adf-cli/bin/adf-cli init-aae-env --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" --modelerUsername "$E2E_MODELER_USERNAME" --modelerPassword "$E2E_MODELER_PASSWORD" --devopsUsername "$E2E_DEVOPS_USERNAME" --devopsPassword "$E2E_DEVOPS_PASSWORD" --clientId 'activiti' || exit 1 - node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST_BPM" -u "$E2E_ADMIN_EMAIL_IDENTITY" -p "$E2E_ADMIN_PASSWORD_IDENTITY" || exit 1 + ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST_BPM" -u "$E2E_ADMIN_EMAIL_IDENTITY" -p "$E2E_ADMIN_PASSWORD_IDENTITY" || exit 1 } if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]]; diff --git a/scripts/travis/e2e/process-services-e2e.sh b/scripts/travis/e2e/process-services-e2e.sh index 09ef01c254..c136987a6e 100755 --- a/scripts/travis/e2e/process-services-e2e.sh +++ b/scripts/travis/e2e/process-services-e2e.sh @@ -14,7 +14,7 @@ if [[ $TRAVIS_PULL_REQUEST == "true" ]]; then AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")"; fi; -node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +./node_modules/@alfresco/adf-cli/bin/adf-cli check-ps-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -m 2 || exit 1) if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]]; diff --git a/scripts/travis/e2e/search-e2e.sh b/scripts/travis/e2e/search-e2e.sh index ceeeb52045..3e32e92ef0 100755 --- a/scripts/travis/e2e/search-e2e.sh +++ b/scripts/travis/e2e/search-e2e.sh @@ -14,7 +14,7 @@ if [[ $TRAVIS_PULL_REQUEST == "true" ]]; then AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")"; fi; -node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 +./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -m 2 || exit 1) if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "content-services" || $TRAVIS_PULL_REQUEST == "false" ]];