fix(azuredeployer.gblib): Fix MSFT changes.
This commit is contained in:
parent
b017f32b04
commit
64d9884b69
6 changed files with 17 additions and 16 deletions
|
@ -113,7 +113,7 @@ export class GBAdminService implements IGBAdminService {
|
||||||
maximumLength: 14
|
maximumLength: 14
|
||||||
};
|
};
|
||||||
let password = passwordGenerator.generatePassword(options);
|
let password = passwordGenerator.generatePassword(options);
|
||||||
password = password.replace(/[\@\[\=\:\;\?\"\'\#]/gi, '1');
|
password = password.replace(/[\@\[\=\:\;\?\"\'\#]/gi, '*');
|
||||||
|
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
|
@ -429,8 +429,6 @@ export class AzureDeployerService implements IGBInstallationDeployer {
|
||||||
const nlpa = await this.createNLPAuthoring(name, `${name}-nlpa`, instance.cloudLocation);
|
const nlpa = await this.createNLPAuthoring(name, `${name}-nlpa`, instance.cloudLocation);
|
||||||
instance.nlpEndpoint = nlp.endpoint;
|
instance.nlpEndpoint = nlp.endpoint;
|
||||||
|
|
||||||
|
|
||||||
GBLog.info(`Waiting for Cognitive objects stack...`);
|
|
||||||
const sleep = ms => {
|
const sleep = ms => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
setTimeout(resolve, ms);
|
setTimeout(resolve, ms);
|
||||||
|
@ -449,7 +447,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
GBLog.info(`Waiting to finishing NLP service and keys creation...`);
|
GBLog.info(`Waiting one minute to finishing NLP service and keys creation...`);
|
||||||
await sleep(60000);
|
await sleep(60000);
|
||||||
keys = await this.cognitiveClient.accounts.listKeys(name, textAnalytics.name);
|
keys = await this.cognitiveClient.accounts.listKeys(name, textAnalytics.name);
|
||||||
instance.textAnalyticsKey = keys.key1;
|
instance.textAnalyticsKey = keys.key1;
|
||||||
|
|
|
@ -198,16 +198,6 @@ export class GBDeployer implements IGBDeployer {
|
||||||
await this.deployAppPackages(list, core, appPackages);
|
await this.deployAppPackages(list, core, appPackages);
|
||||||
|
|
||||||
GBLog.info(`App Package deployment done.`);
|
GBLog.info(`App Package deployment done.`);
|
||||||
|
|
||||||
// Then all remaining general packages are loaded.
|
|
||||||
|
|
||||||
const instances = await core.loadInstances();
|
|
||||||
await CollectionUtil.asyncForEach(instances, async instance => {
|
|
||||||
this.mountGBKBAssets(`${instance.botId}.gbkb`,
|
|
||||||
instance.botId, `${instance.botId}.gbkb`);
|
|
||||||
});
|
|
||||||
|
|
||||||
GBLog.info(`Package deployment done.`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -821,7 +811,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
/**
|
/**
|
||||||
* Servers bot storage assets to be used by web, WhatsApp and other channels.
|
* Servers bot storage assets to be used by web, WhatsApp and other channels.
|
||||||
*/
|
*/
|
||||||
public mountGBKBAssets(packageName: any, botId: string, filename: string) {
|
public static mountGBKBAssets(packageName: any, botId: string, filename: string) {
|
||||||
|
|
||||||
// Servers menu assets.
|
// Servers menu assets.
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,16 @@ export class GBMinService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Then all remaining general packages are loaded.
|
||||||
|
|
||||||
|
await CollectionUtil.asyncForEach(instances, async instance => {
|
||||||
|
GBDeployer.mountGBKBAssets(`${instance.botId}.gbkb`,
|
||||||
|
instance.botId, `${instance.botId}.gbkb`);
|
||||||
|
});
|
||||||
|
|
||||||
|
GBLog.info(`Package deployment done.`);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -710,7 +710,7 @@ export class KBService implements IGBKBService {
|
||||||
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
|
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
|
||||||
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
|
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
|
||||||
await this.importKbPackage(min, localPath, p, instance);
|
await this.importKbPackage(min, localPath, p, instance);
|
||||||
deployer.mountGBKBAssets(packageName, min.botId, localPath);
|
GBDeployer.mountGBKBAssets(packageName, min.botId, localPath);
|
||||||
|
|
||||||
await deployer.rebuildIndex(instance, new AzureDeployerService(deployer).getKBSearchSchema(instance.searchIndex));
|
await deployer.rebuildIndex(instance, new AzureDeployerService(deployer).getKBSearchSchema(instance.searchIndex));
|
||||||
GBLog.info(`[GBDeployer] Finished import of ${localPath}`);
|
GBLog.info(`[GBDeployer] Finished import of ${localPath}`);
|
||||||
|
|
|
@ -155,6 +155,7 @@ export class GBServer {
|
||||||
await deployer.deployPackages(core, server, GBServer.globals.appPackages);
|
await deployer.deployPackages(core, server, GBServer.globals.appPackages);
|
||||||
await core.syncDatabaseStructure();
|
await core.syncDatabaseStructure();
|
||||||
|
|
||||||
|
|
||||||
GBLog.info(`Publishing instances...`);
|
GBLog.info(`Publishing instances...`);
|
||||||
const instances: IGBInstance[] = await core.loadAllInstances(
|
const instances: IGBInstance[] = await core.loadAllInstances(
|
||||||
core,
|
core,
|
||||||
|
@ -173,6 +174,8 @@ export class GBServer {
|
||||||
await deployer.deployBotFull(instance, GBServer.globals.publicAddress);
|
await deployer.deployBotFull(instance, GBServer.globals.publicAddress);
|
||||||
instances.push(instance);
|
instances.push(instance);
|
||||||
|
|
||||||
|
// Runs the search even with empty content to create structure.
|
||||||
|
|
||||||
await azureDeployer['runSearch'](instance);
|
await azureDeployer['runSearch'](instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue