Skip to content

Commit

Permalink
Fix build failure and trigger pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
snehapar9 committed Sep 24, 2023
1 parent 5f2e255 commit fd23345
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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);
Expand Down Expand Up @@ -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];
Expand Down
7 changes: 4 additions & 3 deletions src/ContainerAppHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fd23345

Please sign in to comment.