fix(core.gbapp): Boot process fully tested.
This commit is contained in:
parent
657dd0b849
commit
a6d1f90bbf
3 changed files with 51 additions and 32 deletions
|
@ -170,7 +170,7 @@ export class GBAdminService implements IGBAdminService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static isSharePointPath(path: string) {
|
public static isSharePointPath(path: string) {
|
||||||
return path.indexOf('sharepoint.com') > 0;
|
return path.indexOf('sharepoint.com') !== -1;
|
||||||
}
|
}
|
||||||
public static async deployPackageCommand(min: GBMinInstance, text: string, deployer: IGBDeployer) {
|
public static async deployPackageCommand(min: GBMinInstance, text: string, deployer: IGBDeployer) {
|
||||||
const packageName = text.split(' ')[1];
|
const packageName = text.split(' ')[1];
|
||||||
|
|
|
@ -853,36 +853,55 @@ export class AzureDeployerService implements IGBInstallationDeployer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async createServer(farmId, group, name, location) {
|
private async createServer(farmId, group, name, location) {
|
||||||
const parameters: Site = {
|
|
||||||
location: location,
|
|
||||||
serverFarmId: farmId,
|
|
||||||
|
|
||||||
siteConfig: {
|
let tryed = false;
|
||||||
nodeVersion: GBAdminService.getNodeVersion(),
|
const create = async () => {
|
||||||
detailedErrorLoggingEnabled: true,
|
|
||||||
requestTracingEnabled: true
|
const parameters: Site = {
|
||||||
|
location: location,
|
||||||
|
serverFarmId: farmId,
|
||||||
|
|
||||||
|
siteConfig: {
|
||||||
|
nodeVersion: GBAdminService.getNodeVersion(),
|
||||||
|
detailedErrorLoggingEnabled: true,
|
||||||
|
requestTracingEnabled: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const server = await this.webSiteClient.webApps.createOrUpdate(group, name, parameters);
|
||||||
|
|
||||||
|
const siteLogsConfig: SiteLogsConfig = {
|
||||||
|
applicationLogs: {
|
||||||
|
fileSystem: { level: 'Error' }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await this.webSiteClient.webApps.updateDiagnosticLogsConfig(group, name, siteLogsConfig);
|
||||||
|
|
||||||
|
const souceControlConfig: SiteSourceControl = {
|
||||||
|
repoUrl: 'https://github.com/GeneralBots/BotServer.git',
|
||||||
|
branch: 'master',
|
||||||
|
isManualIntegration: true,
|
||||||
|
isMercurial: false,
|
||||||
|
deploymentRollbackEnabled: false
|
||||||
|
};
|
||||||
|
|
||||||
|
await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig);
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
return await create();
|
||||||
|
} catch (e) {
|
||||||
|
if (!tryed) {
|
||||||
|
tryed = true;
|
||||||
|
GBLog.info('Retrying Deploying Bot Server...');
|
||||||
|
try {
|
||||||
|
return await create();
|
||||||
|
} catch (error) {
|
||||||
|
GBLog.info('Server creation failed at all on MSAzure, stopping...');
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const server = await this.webSiteClient.webApps.createOrUpdate(group, name, parameters);
|
|
||||||
|
|
||||||
const siteLogsConfig: SiteLogsConfig = {
|
|
||||||
applicationLogs: {
|
|
||||||
fileSystem: { level: 'Error' }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
await this.webSiteClient.webApps.updateDiagnosticLogsConfig(group, name, siteLogsConfig);
|
|
||||||
|
|
||||||
const souceControlConfig: SiteSourceControl = {
|
|
||||||
repoUrl: 'https://github.com/GeneralBots/BotServer.git',
|
|
||||||
branch: 'master',
|
|
||||||
isManualIntegration: true,
|
|
||||||
isMercurial: false,
|
|
||||||
deploymentRollbackEnabled: false
|
|
||||||
};
|
|
||||||
|
|
||||||
await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig);
|
|
||||||
|
|
||||||
return server;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateWebisteConfig(group, name, serverFarmId, instance: IGBInstance) {
|
private async updateWebisteConfig(group, name, serverFarmId, instance: IGBInstance) {
|
||||||
|
|
|
@ -635,7 +635,7 @@ export class GBMinService {
|
||||||
// If there is WhatsApp configuration specified, initialize
|
// If there is WhatsApp configuration specified, initialize
|
||||||
// infrastructure objects.
|
// infrastructure objects.
|
||||||
|
|
||||||
if (min.instance.whatsappServiceUrl !== null) {
|
if (min.instance.whatsappServiceUrl) {
|
||||||
min.whatsAppDirectLine = new WhatsappDirectLine(
|
min.whatsAppDirectLine = new WhatsappDirectLine(
|
||||||
min,
|
min,
|
||||||
min.botId,
|
min.botId,
|
||||||
|
|
Loading…
Add table
Reference in a new issue