From ea2178dcac707ab105a52ce0d08d38c759958273 Mon Sep 17 00:00:00 2001 From: snehapar9 Date: Sun, 5 Nov 2023 20:50:29 -0800 Subject: [PATCH] Test validation pipeline --- azurecontainerapps.ts | 4 ++-- dist/index.js | 8 ++++---- src/ContainerAppHelper.ts | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index c9cfa41b..e5c1529a 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -532,7 +532,7 @@ export class azurecontainerapps { await this.appHelper.createContainerAppFromYaml(this.containerAppName, this.resourceGroup, this.yamlConfigPath); } else if (this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) { // Create the Container App from the command line arguments - await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.commandLineArgs); + await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.location, this.commandLineArgs); } else { // Create the Container App from command line arguments await this.appHelper.createContainerApp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.imageToDeploy, this.commandLineArgs); @@ -558,7 +558,7 @@ export class azurecontainerapps { await this.appHelper.updateContainerApp(this.containerAppName, this.resourceGroup, this.imageToDeploy, this.commandLineArgs); } else if (this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) { // Create the Container App from the command line arguments - await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.commandLineArgs); + await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.location, this.commandLineArgs); } else { // Update the Container App using the 'up' command await this.appHelper.updateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.imageToDeploy, this.commandLineArgs, this.ingress, this.targetPort); diff --git a/dist/index.js b/dist/index.js index fcad265d..6b38d3b4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -631,7 +631,7 @@ var azurecontainerapps = /** @class */ (function () { case 2: if (!(this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath))) return [3 /*break*/, 4]; // Create the Container App from the command line arguments - return [4 /*yield*/, this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.commandLineArgs)]; + return [4 /*yield*/, this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.location, this.commandLineArgs)]; case 3: // Create the Container App from the command line arguments _a.sent(); @@ -669,7 +669,7 @@ var azurecontainerapps = /** @class */ (function () { case 13: if (!(this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath))) return [3 /*break*/, 15]; // Create the Container App from the command line arguments - return [4 /*yield*/, this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.commandLineArgs)]; + return [4 /*yield*/, this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.appSourcePath, this.location, this.commandLineArgs)]; case 14: // Create the Container App from the command line arguments _a.sent(); @@ -4754,7 +4754,7 @@ var ContainerAppHelper = /** @class */ (function () { * @param appSourcePath - the path to the application source * @param optionalCmdArgs - a set of optional command line arguments */ - ContainerAppHelper.prototype.createOrUpdateContainerAppWithUp = function (containerAppName, resourceGroup, environment, appSourcePath, optionalCmdArgs) { + ContainerAppHelper.prototype.createOrUpdateContainerAppWithUp = function (containerAppName, resourceGroup, environment, appSourcePath, location, optionalCmdArgs) { return __awaiter(this, void 0, void 0, function () { var command_2, err_2; return __generator(this, function (_a) { @@ -4764,7 +4764,7 @@ var ContainerAppHelper = /** @class */ (function () { _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - command_2 = "az containerapp up -n " + containerAppName + " -g " + resourceGroup + " --source " + appSourcePath + " --environment " + environment; + command_2 = "az containerapp up -n " + containerAppName + " -g " + resourceGroup + " --source " + appSourcePath + " --environment " + environment + " --location " + location; optionalCmdArgs.forEach(function (val) { command_2 += " " + val; }); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index f3b40f6c..7166251d 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -58,10 +58,11 @@ export class ContainerAppHelper { resourceGroup: string, environment: string, appSourcePath: string, + location: string, optionalCmdArgs: string[]) { toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}" based on the application source path "${appSourcePath}"`); try { - let command = `az containerapp up -n ${containerAppName} -g ${resourceGroup} --source ${appSourcePath} --environment ${environment}`; + let command = `az containerapp up -n ${containerAppName} -g ${resourceGroup} --source ${appSourcePath} --environment ${environment} --location ${location}`; optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; });