fix(core.gbapp): Self-replication on Azure

This commit is contained in:
Rodrigo Rodriguez 2019-05-27 13:52:10 -03:00
parent 25091573a0
commit 5f0fb3bc3e
2 changed files with 11 additions and 16 deletions

View file

@ -404,18 +404,9 @@ export class AzureDeployerService implements IGBInstallationDeployer {
instance.botEndpoint = this.defaultEndPoint; instance.botEndpoint = this.defaultEndPoint;
instance = await this.internalDeployBot( instance = await this.internalDeployBot(
instance, instance, this.accessToken, name, name, name, 'General BootBot',
this.accessToken, `${proxyAddress}/api/messages/${name}`, 'global',
name, instance.nlpAppId, instance.nlpKey, instance.marketplaceId, instance.marketplacePassword,
name,
name,
'General BootBot',
`${proxyAddress}/api/messages/${name}`,
'global',
instance.nlpAppId,
instance.nlpKey,
instance.marketplaceId,
instance.marketplacePassword,
instance.cloudSubscriptionId instance.cloudSubscriptionId
); );
@ -424,6 +415,10 @@ export class AzureDeployerService implements IGBInstallationDeployer {
spinner.stop(); spinner.stop();
GBLog.info('Opening your browser with default.gbui...');
const opn = require('opn');
opn(`https://${serverName}.azurewebsites.net`);
return instance; return instance;
} }
@ -451,7 +446,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
const credentials = await GBAdminService.getADALCredentialsFromUsername(username, password); const credentials = await GBAdminService.getADALCredentialsFromUsername(username, password);
// tslint:disable-next-line:no-http-string // tslint:disable-next-line:no-http-string
const url = `http://${instance.botId}.azurewebsites.net`; const url = `https://${instance.botId}.azurewebsites.net`;
this.deployFarm(url, instance, credentials, subscriptionId); this.deployFarm(url, instance, credentials, subscriptionId);
} }
@ -713,7 +708,6 @@ export class AzureDeployerService implements IGBInstallationDeployer {
}; };
await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig); await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig);
// await this.webSiteClient.webApps.syncRepository(name, name);
return server; return server;
} }
@ -725,10 +719,11 @@ export class AzureDeployerService implements IGBInstallationDeployer {
serverFarmId: serverFarmId, serverFarmId: serverFarmId,
siteConfig: { siteConfig: {
appSettings: [ appSettings: [
{ name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: webSiteResponseTimeout }, { name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: WebSiteResponseTimeout },
{ name: 'WEBSITE_NODE_DEFAULT_VERSION', value: GBAdminService.getNodeVersion() }, { name: 'WEBSITE_NODE_DEFAULT_VERSION', value: GBAdminService.getNodeVersion() },
{ name: 'ADDITIONAL_DEPLOY_PATH', value: `` }, { name: 'ADDITIONAL_DEPLOY_PATH', value: `` },
{ name: 'ADMIN_PASS', value: `${instance.adminPass}` }, { name: 'ADMIN_PASS', value: `${instance.adminPass}` },
{ name: 'BOT_ID', value: `${instance.botId}` },
{ name: 'CLOUD_SUBSCRIPTIONID', value: `${instance.cloudSubscriptionId}` }, { name: 'CLOUD_SUBSCRIPTIONID', value: `${instance.cloudSubscriptionId}` },
{ name: 'CLOUD_LOCATION', value: `${instance.cloudLocation}` }, { name: 'CLOUD_LOCATION', value: `${instance.cloudLocation}` },
{ name: 'CLOUD_GROUP', value: `${instance.botId}` }, { name: 'CLOUD_GROUP', value: `${instance.botId}` },

View file

@ -99,7 +99,7 @@ export class GBServer {
GBLog.info(`Establishing a development local proxy (ngrok)...`); GBLog.info(`Establishing a development local proxy (ngrok)...`);
GBServer.globals.publicAddress = await core.ensureProxy(port); GBServer.globals.publicAddress = await core.ensureProxy(port);
} else { } else {
const serverAddress = `http://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`; const serverAddress = `https://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`;
GBLog.info(`Defining server address at ${serverAddress}...`); GBLog.info(`Defining server address at ${serverAddress}...`);
GBServer.globals.publicAddress = serverAddress; GBServer.globals.publicAddress = serverAddress;
} }