fix(all): yarn vs npm on MSFT.
This commit is contained in:
parent
33b6694598
commit
97f5f154c0
2 changed files with 20 additions and 7 deletions
|
@ -87,9 +87,9 @@ eval ./node_modules/typescript/bin/tsc -p "$DEPLOYMENT_SOURCE"
|
||||||
if [ -e "$DEPLOYMENT_SOURCE/packages/default.gbui/package.json" ]; then
|
if [ -e "$DEPLOYMENT_SOURCE/packages/default.gbui/package.json" ]; then
|
||||||
echo "[General Bots Deployer] Running npm install for default.gbui..."
|
echo "[General Bots Deployer] Running npm install for default.gbui..."
|
||||||
cd "$DEPLOYMENT_SOURCE/packages/default.gbui"
|
cd "$DEPLOYMENT_SOURCE/packages/default.gbui"
|
||||||
eval npm install
|
eval yarn install
|
||||||
exitWithMessageOnError "npm failed"
|
exitWithMessageOnError "npm failed"
|
||||||
echo "[General Bots Deployer] Building react app..."
|
echo "[Genseral Bots Deployer] Building react app..."
|
||||||
eval npm run build
|
eval npm run build
|
||||||
echo "[General Bots Deployer] OK."
|
echo "[General Bots Deployer] OK."
|
||||||
cd "$DEPLOYMENT_SOURCE"
|
cd "$DEPLOYMENT_SOURCE"
|
||||||
|
|
23
src/app.ts
23
src/app.ts
|
@ -38,10 +38,11 @@
|
||||||
|
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
import * as fs from 'fs';
|
const https = require('https');
|
||||||
const mkdirp = require('mkdirp');
|
const mkdirp = require('mkdirp');
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
|
|
||||||
|
import * as fs from 'fs';
|
||||||
import { GBLog, GBMinInstance, IGBCoreService, IGBInstance, IGBPackage } from 'botlib';
|
import { GBLog, GBMinInstance, IGBCoreService, IGBInstance, IGBPackage } from 'botlib';
|
||||||
import { GBAdminService } from '../packages/admin.gbapp/services/GBAdminService';
|
import { GBAdminService } from '../packages/admin.gbapp/services/GBAdminService';
|
||||||
import { AzureDeployerService } from '../packages/azuredeployer.gbapp/services/AzureDeployerService';
|
import { AzureDeployerService } from '../packages/azuredeployer.gbapp/services/AzureDeployerService';
|
||||||
|
@ -52,6 +53,7 @@ import { GBDeployer } from '../packages/core.gbapp/services/GBDeployer';
|
||||||
import { GBImporter } from '../packages/core.gbapp/services/GBImporterService';
|
import { GBImporter } from '../packages/core.gbapp/services/GBImporterService';
|
||||||
import { GBMinService } from '../packages/core.gbapp/services/GBMinService';
|
import { GBMinService } from '../packages/core.gbapp/services/GBMinService';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global shared server data;
|
* Global shared server data;
|
||||||
*/
|
*/
|
||||||
|
@ -83,7 +85,6 @@ export class GBServer {
|
||||||
GBLog.info(`The Bot Server is in STARTING mode...`);
|
GBLog.info(`The Bot Server is in STARTING mode...`);
|
||||||
GBServer.globals = new RootData();
|
GBServer.globals = new RootData();
|
||||||
GBConfigService.init();
|
GBConfigService.init();
|
||||||
|
|
||||||
const port = GBConfigService.getServerPort();
|
const port = GBConfigService.getServerPort();
|
||||||
const server = express();
|
const server = express();
|
||||||
GBServer.globals.server = server;
|
GBServer.globals.server = server;
|
||||||
|
@ -96,7 +97,7 @@ export class GBServer {
|
||||||
server.use(bodyParser.json());
|
server.use(bodyParser.json());
|
||||||
server.use(bodyParser.urlencoded({ extended: true }));
|
server.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
|
||||||
|
|
||||||
// Creates working directory.
|
// Creates working directory.
|
||||||
|
|
||||||
const workDir = Path.join(process.env.PWD, 'work');
|
const workDir = Path.join(process.env.PWD, 'work');
|
||||||
|
@ -104,7 +105,7 @@ export class GBServer {
|
||||||
mkdirp.sync(workDir);
|
mkdirp.sync(workDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
server.listen(port, () => {
|
const mainCallback = () => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -208,6 +209,18 @@ export class GBServer {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
});
|
};
|
||||||
|
if (process.env.ENABLE_HTTPS) {
|
||||||
|
const sslOptions = {
|
||||||
|
key: fs.readFileSync('certificates/gb.key', 'utf8'),
|
||||||
|
cert: fs.readFileSync('certificates/gb.crt', 'utf8'),
|
||||||
|
ca: fs.readFileSync('certificates/gb-ca.crt', 'utf8'),
|
||||||
|
};
|
||||||
|
|
||||||
|
https.createServer(sslOptions, server).listen(port);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
server.listen(port, mainCallback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue