From 05005d153db3ebb81ef183ca181b1658a1cb1598 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sat, 25 May 2019 18:31:19 +0000 Subject: [PATCH 1/4] chore(release): 1.3.1 [skip ci] ## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) ### Bug Fixes * **core.gbapp:** Azure deployment. ([f1b8eb2](https://github.com/pragmatismo-io/BotServer/commit/f1b8eb2)) * **core.gbapp:** Azure deployment. ([49e1743](https://github.com/pragmatismo-io/BotServer/commit/49e1743)) * **core.gbapp:** Azure Deployment. ([f8fab38](https://github.com/pragmatismo-io/BotServer/commit/f8fab38)) * **core.gbapp:** ESNext in tsconfig.json to match MSFT. ([01b8dd5](https://github.com/pragmatismo-io/BotServer/commit/01b8dd5)) * **core.gbapp:** Fixing loading of instances. ([bc9c588](https://github.com/pragmatismo-io/BotServer/commit/bc9c588)) * **core.gbapp:** Investigating BASIC broken. ([f0ec25e](https://github.com/pragmatismo-io/BotServer/commit/f0ec25e)) * **core.gbapp:** package.json artifacts sync. ([01d34a6](https://github.com/pragmatismo-io/BotServer/commit/01d34a6)) * **core.gbapp:** Publishing in Azure. ([4d6779e](https://github.com/pragmatismo-io/BotServer/commit/4d6779e)) * **core.gbapp:** Removing POC code. ([56f46f4](https://github.com/pragmatismo-io/BotServer/commit/56f46f4)) * **kb.gbapp:** Typo fix. ([ba26578](https://github.com/pragmatismo-io/BotServer/commit/ba26578)) * **whatsapp.gblib:** Enabling Whatsapp. ([4351b87](https://github.com/pragmatismo-io/BotServer/commit/4351b87)) * **whatsapp.gblib:** Enabling Whatsapp. ([74f5936](https://github.com/pragmatismo-io/BotServer/commit/74f5936)) * **whatsapp.lib:** Enabling Whatsapp. ([85249e5](https://github.com/pragmatismo-io/BotServer/commit/85249e5)) --- CHANGELOG.md | 19 +++++++++++++++++++ package.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7ea92f..a14a2b88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) + + +### Bug Fixes + +* **core.gbapp:** Azure deployment. ([f1b8eb2](https://github.com/pragmatismo-io/BotServer/commit/f1b8eb2)) +* **core.gbapp:** Azure deployment. ([49e1743](https://github.com/pragmatismo-io/BotServer/commit/49e1743)) +* **core.gbapp:** Azure Deployment. ([f8fab38](https://github.com/pragmatismo-io/BotServer/commit/f8fab38)) +* **core.gbapp:** ESNext in tsconfig.json to match MSFT. ([01b8dd5](https://github.com/pragmatismo-io/BotServer/commit/01b8dd5)) +* **core.gbapp:** Fixing loading of instances. ([bc9c588](https://github.com/pragmatismo-io/BotServer/commit/bc9c588)) +* **core.gbapp:** Investigating BASIC broken. ([f0ec25e](https://github.com/pragmatismo-io/BotServer/commit/f0ec25e)) +* **core.gbapp:** package.json artifacts sync. ([01d34a6](https://github.com/pragmatismo-io/BotServer/commit/01d34a6)) +* **core.gbapp:** Publishing in Azure. ([4d6779e](https://github.com/pragmatismo-io/BotServer/commit/4d6779e)) +* **core.gbapp:** Removing POC code. ([56f46f4](https://github.com/pragmatismo-io/BotServer/commit/56f46f4)) +* **kb.gbapp:** Typo fix. ([ba26578](https://github.com/pragmatismo-io/BotServer/commit/ba26578)) +* **whatsapp.gblib:** Enabling Whatsapp. ([4351b87](https://github.com/pragmatismo-io/BotServer/commit/4351b87)) +* **whatsapp.gblib:** Enabling Whatsapp. ([74f5936](https://github.com/pragmatismo-io/BotServer/commit/74f5936)) +* **whatsapp.lib:** Enabling Whatsapp. ([85249e5](https://github.com/pragmatismo-io/BotServer/commit/85249e5)) + # [1.3.0](https://github.com/pragmatismo-io/BotServer/compare/1.2.2...1.3.0) (2019-05-12) diff --git a/package.json b/package.json index 24b2dd19..6441563e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.0", + "version": "1.3.1", "description": "General Bot Community Edition open-core server.", "main": "./src/app.ts", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", -- 2.39.5 From 488de3895b5604fb93e35d2c7ccdd87811907904 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sun, 26 May 2019 23:41:29 +0000 Subject: [PATCH 2/4] chore(release): 1.3.2 [skip ci] ## [1.3.2](https://github.com/pragmatismo-io/BotServer/compare/1.3.1...1.3.2) (2019-05-26) ### Bug Fixes * **core.gbapp:** Self-replication on Azure. ([2ccae38](https://github.com/pragmatismo-io/BotServer/commit/2ccae38)) * **core.gbapp:** Self-replication on Azure. ([4b7d29d](https://github.com/pragmatismo-io/BotServer/commit/4b7d29d)) --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a14a2b88..1e7d6fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.3.2](https://github.com/pragmatismo-io/BotServer/compare/1.3.1...1.3.2) (2019-05-26) + + +### Bug Fixes + +* **core.gbapp:** Self-replication on Azure. ([2ccae38](https://github.com/pragmatismo-io/BotServer/commit/2ccae38)) +* **core.gbapp:** Self-replication on Azure. ([4b7d29d](https://github.com/pragmatismo-io/BotServer/commit/4b7d29d)) + ## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) diff --git a/package.json b/package.json index 6441563e..8a5fd116 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.1", + "version": "1.3.2", "description": "General Bot Community Edition open-core server.", "main": "./src/app.ts", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", -- 2.39.5 From 3cca5044ee001b8e058c57b2d9558912a813af9b Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Mon, 27 May 2019 08:16:43 -0300 Subject: [PATCH 3/4] fix(core.gbapp): Self-replication on Azure --- packages/core.gbapp/services/GBDeployer.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 9fc0e1a4..f1a6d478 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -404,15 +404,22 @@ export class GBDeployer { return { generalPackages, totalPackages }; } + private isSystemPackage(name: string): Boolean { + const names = ['core.gbapp', 'admin.gbapp', 'azuredeployer.gbapp', 'customer-satisfaction.gbapp', 'kb.gbapp']; + + return names.indexOf(name) > -1; + } + private deployAppPackages(gbappPackages: string[], core: any, appPackages: any[]) { let appPackagesProcessed = 0; gbappPackages.forEach(e => { - // Skips .gbapp inside deploy folder. - if (!e.startsWith('packages')) { - GBLog.info(`Deploying app: ${e}...`); + const filenameOnly = Path.basename(e); + // Skips .gbapp inside deploy folder. + if (this.isSystemPackage(filenameOnly) === false) { + + GBLog.info(`Deploying app: ${e}...`); let folder = Path.join(e, 'node_modules'); - let if (!Fs.existsSync(folder)) { GBLog.info(`Installing modules for ${e}...`); child_process.execSync('npm install', { cwd: e }); -- 2.39.5 From bf602c6b7d5de06add2357ac7c110d307c99c0dd Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Mon, 27 May 2019 08:46:17 -0300 Subject: [PATCH 4/4] fix(core.gbapp): Self-replication on Azure --- .vscode/launch.json | 16 +++++++++++----- boot.js | 4 ++++ gbot.cmd | 2 +- package.json | 8 ++++---- packages/core.gbapp/services/GBDeployer.ts | 2 +- src/app.ts | 15 +-------------- web.config | 6 ++---- 7 files changed, 24 insertions(+), 29 deletions(-) create mode 100644 boot.js diff --git a/.vscode/launch.json b/.vscode/launch.json index f948be78..b5e438ba 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,16 +5,22 @@ "type": "node", "request": "launch", "name": "Debug Program", - "program": "${workspaceRoot}/dist/src/app.js", + "program": "${workspaceRoot}/boot.js", "cwd": "${workspaceRoot}", "env": { "NODE_ENV": "development" }, - "args":["--no-deprecation"], - "skipFiles": ["node_modules/**/*.js"], - "outFiles": ["${workspaceRoot}/dist/*.js"], + "args": [ + "--no-deprecation" + ], + "skipFiles": [ + "node_modules/**/*.js" + ], + "outFiles": [ + "${workspaceRoot}/dist/*.js" + ], "stopOnEntry": false, "console": "integratedTerminal" } ] -} +} \ No newline at end of file diff --git a/boot.js b/boot.js new file mode 100644 index 00000000..b8224477 --- /dev/null +++ b/boot.js @@ -0,0 +1,4 @@ +#! /usr/bin / env node +const GBServer = require("./dist/src/app").GBServer +process.env.PWD = __dirname; +GBServer.run(); \ No newline at end of file diff --git a/gbot.cmd b/gbot.cmd index 243b11c5..4e2690a4 100644 --- a/gbot.cmd +++ b/gbot.cmd @@ -12,4 +12,4 @@ ECHO Compiling... CALL tsc :ALLSET -node dist/src/app.js +node app.js diff --git a/package.json b/package.json index 24b2dd19..a0e9e707 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "botserver", "version": "1.3.0", "description": "General Bot Community Edition open-core server.", - "main": "./src/app.ts", + "main": "./boot.js", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", "homepage": "https://github.com/pragmatismo-io/BotServer/#readme", "contributors": [ @@ -15,7 +15,7 @@ "license": "AGPL-3.0", "preferGlobal": true, "bin": { - "gbot": "./dist/src/app.js" + "gbot": "./boot.js" }, "repository": { "type": "git", @@ -31,7 +31,7 @@ "test": "nyc --reporter=html --reporter=text mocha -r ts-node/register packages/**/*.test.ts ", "pretest": "npm run build", "coveralls": "npm run test && nyc report --reporter=text-lcov | coveralls", - "start": "node ./dist/src/app.js", + "start": "node ./boot.js", "watch:build": "tsc --watch", "watch:server": "nodemon './dist/index.js' --watch './dist'", "posttypedoc": "shx cp .nojekyll docs/reference/.nojekyll", @@ -245,4 +245,4 @@ "post-merge": [] } } -} +} \ No newline at end of file diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index f1a6d478..1d0d7d96 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -93,7 +93,7 @@ export class GBDeployer { (resolve: any, reject: any): any => { GBLog.info(`PWD ${process.env.PWD}...`); let totalPackages = 0; - let paths = [urlJoin(process.env.PWD, '..', GBDeployer.deployFolder)]; + let paths = [urlJoin(process.env.PWD, GBDeployer.deployFolder)]; const additionalPath = GBConfigService.get('ADDITIONAL_DEPLOY_PATH'); if (additionalPath !== undefined && additionalPath !== '') { paths = paths.concat(additionalPath.toLowerCase().split(';')); diff --git a/src/app.ts b/src/app.ts index 5b0be517..7367e727 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,4 +1,3 @@ -#! /usr/bin / env node /*****************************************************************************\ | ( )_ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | @@ -72,19 +71,11 @@ export class GBServer { public static run() { GBLog.info(`The Bot Server is in STARTING mode...`); - process.env.PWD = __dirname; - - // Creates a basic HTTP server that will serve several URL, one for each bot instance. - GBServer.globals = new RootData(); const port = GBConfigService.getServerPort(); const server = express(); server.use(bodyParser.json()); - server.use( - bodyParser.urlencoded({ - extended: true - }) - ); + server.use(bodyParser.urlencoded({ extended: true })); server.listen(port, () => { (async () => { @@ -171,7 +162,3 @@ export class GBServer { }); } } - -// First line to run. - -GBServer.run(); diff --git a/web.config b/web.config index 63d1eaf3..4e041961 100644 --- a/web.config +++ b/web.config @@ -2,7 +2,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -35,5 +35,3 @@ - - \ No newline at end of file -- 2.39.5