Skip to content

Commit

Permalink
fix(azuredeployer.gblib): Fix MSFT changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Nov 29, 2021
1 parent b017f32 commit 64d9884
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/admin.gbapp/services/GBAdminService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class GBAdminService implements IGBAdminService {
maximumLength: 14
};
let password = passwordGenerator.generatePassword(options);
password = password.replace(/[\@\[\=\:\;\?\"\'\#]/gi, '1');
password = password.replace(/[\@\[\=\:\;\?\"\'\#]/gi, '*');

return password;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ export class AzureDeployerService implements IGBInstallationDeployer {
const nlpa = await this.createNLPAuthoring(name, `${name}-nlpa`, instance.cloudLocation);
instance.nlpEndpoint = nlp.endpoint;


GBLog.info(`Waiting for Cognitive objects stack...`);
const sleep = ms => {
return new Promise(resolve => {
setTimeout(resolve, ms);
Expand All @@ -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);
keys = await this.cognitiveClient.accounts.listKeys(name, textAnalytics.name);
instance.textAnalyticsKey = keys.key1;
Expand Down
12 changes: 1 addition & 11 deletions packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,6 @@ export class GBDeployer implements IGBDeployer {
await this.deployAppPackages(list, core, appPackages);

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.`);
}

/**
Expand Down Expand Up @@ -821,7 +811,7 @@ export class GBDeployer implements IGBDeployer {
/**
* 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.

Expand Down
10 changes: 10 additions & 0 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);


}


Expand Down
2 changes: 1 addition & 1 deletion packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export class KBService implements IGBKBService {
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
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));
GBLog.info(`[GBDeployer] Finished import of ${localPath}`);
Expand Down
3 changes: 3 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export class GBServer {
await deployer.deployPackages(core, server, GBServer.globals.appPackages);
await core.syncDatabaseStructure();


GBLog.info(`Publishing instances...`);
const instances: IGBInstance[] = await core.loadAllInstances(
core,
Expand All @@ -173,6 +174,8 @@ export class GBServer {
await deployer.deployBotFull(instance, GBServer.globals.publicAddress);
instances.push(instance);

// Runs the search even with empty content to create structure.

await azureDeployer['runSearch'](instance);
}

Expand Down

0 comments on commit 64d9884

Please sign in to comment.