Skip to content

Commit

Permalink
fix(core.gbapp): Self-replication on Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed May 27, 2019
1 parent 8850370 commit 2509157
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core.gbapp/services/GBCoreService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export class GBCoreService implements IGBCoreService {
public async writeEnv(instance: IGBInstance) {
const env = `ADDITIONAL_DEPLOY_PATH=
ADMIN_PASS=${instance.adminPass}
BOT_ID=${instance.botId}
CLOUD_SUBSCRIPTIONID=${instance.cloudSubscriptionId}
CLOUD_LOCATION=${instance.cloudLocation}
CLOUD_GROUP=${instance.botId}
Expand Down
4 changes: 4 additions & 0 deletions packages/core.gbapp/services/GBImporterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { IGBCoreService, IGBInstance } from 'botlib';
import fs = require('fs');
import urlJoin = require('url-join');
import { GuaribasInstance } from '../models/GBModel';
import { GBConfigService } from './GBConfigService';

/**
* Handles the importing of packages.
Expand All @@ -56,6 +57,9 @@ export class GBImporter {
if (botId === undefined) {
botId = packageJson.botId;
}
if (botId === undefined) {
botId = GBConfigService.get('BOT_ID');
}
const instance = await this.core.loadInstance(botId);

return await this.createOrUpdateInstanceInternal(instance, botId, localPath, packageJson);
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class GBMinService {
*/
private async sendInstanceToClient(req, bootInstance: IGBInstance, res: any, webchatToken: any) {
let botId = req.params.botId;
if (botId === '[default]') {
if (botId === '[default]'|| botId === undefined) {
botId = GBConfigService.get('BOT_ID');
}
const instance = await this.core.loadInstance(botId);
Expand Down

0 comments on commit 2509157

Please sign in to comment.