From fd23345e973023caa857c0a877f5e0e85b6d82b6 Mon Sep 17 00:00:00 2001 From: snehapar9 Date: Sat, 23 Sep 2023 20:19:26 -0700 Subject: [PATCH] Fix build failure and trigger pipeline --- dist/index.js | 11 ++++++----- src/ContainerAppHelper.ts | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 91d4dd62..f51c74b0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4826,7 +4826,7 @@ var ContainerAppHelper = /** @class */ (function () { */ ContainerAppHelper.prototype.doesContainerAppExist = function (containerAppName, resourceGroup) { return __awaiter(this, void 0, void 0, function () { - var command, executionResult, err_6; + var command, exitCode, err_6; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -4835,10 +4835,11 @@ var ContainerAppHelper = /** @class */ (function () { case 1: _a.trys.push([1, 3, , 4]); command = "containerapp show -n " + containerAppName + " -g " + resourceGroup + " -o none"; - return [4 /*yield*/, new Utility_1.Utility().executeAndthrowIfError("az", command.split(' '))]; + return [4 /*yield*/, exec.exec("az", command.split(' '))]; case 2: - executionResult = _a.sent(); - return [2 /*return*/, !executionResult.stderr]; + exitCode = _a.sent(); + // const executionResult = await new Utility().executeAndthrowIfError(`az`, command.split(' ')); + return [2 /*return*/, exitCode === 0]; case 3: err_6 = _a.sent(); core.warning(err_6.message); @@ -5108,7 +5109,7 @@ var ContainerAppHelper = /** @class */ (function () { if (this.disableTelemetry) { telemetryArg = "--env ORYX_DISABLE_TELEMETRY=true"; } - return [4 /*yield*/, new Utility_1.Utility().executeAndthrowIfError("" + PACK_CMD, ['build', "" + imageToDeploy, '--path', "" + appSourcePath, '--builder', "" + ORYX_BUILDER_IMAGE, '--run-image', "mcr.microsoft.com/oryx/" + runtimeStack, "" + telemetryArg])]; + return [4 /*yield*/, new Utility_1.Utility().executeAndthrowIfError("" + PACK_CMD, ['build', "" + imageToDeploy, '--path', "" + appSourcePath, '--builder', "" + ORYX_BUILDER_IMAGE, '--run-image', "mcr.microsoft.com/oryx/" + runtimeStack, '--env', "ORYX_DISABLE_TELEMETRY=true"])]; case 2: _a.sent(); return [3 /*break*/, 4]; diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index 40a4f499..ae85c8f5 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -161,8 +161,9 @@ export class ContainerAppHelper { core.debug(`Attempting to determine if Container App with name "${containerAppName}" exists in resource group "${resourceGroup}"`); try { const command = `containerapp show -n ${containerAppName} -g ${resourceGroup} -o none`; - const executionResult = await new Utility().executeAndthrowIfError(`az`, command.split(' ')); - return !executionResult.stderr; + const exitCode = await exec.exec(`az`, command.split(' ')); + // const executionResult = await new Utility().executeAndthrowIfError(`az`, command.split(' ')); + return exitCode === 0; } catch (err) { core.warning(err.message); return false; @@ -326,7 +327,7 @@ export class ContainerAppHelper { if (this.disableTelemetry) { telemetryArg = `--env ORYX_DISABLE_TELEMETRY=true`; } - await new Utility().executeAndthrowIfError(`${PACK_CMD}`, ['build', `${imageToDeploy}`, '--path', `${appSourcePath}`, '--builder', `${ORYX_BUILDER_IMAGE}`, '--run-image', `mcr.microsoft.com/oryx/${runtimeStack}`, `${telemetryArg}`]); + await new Utility().executeAndthrowIfError(`${PACK_CMD}`, ['build', `${imageToDeploy}`, '--path', `${appSourcePath}`, '--builder', `${ORYX_BUILDER_IMAGE}`, '--run-image', `mcr.microsoft.com/oryx/${runtimeStack}`, '--env', `ORYX_DISABLE_TELEMETRY=true`]); } catch (err) { core.error(err.message); throw err;