From f8777f6bfd8381da5216c34b568282340e8a1a4b Mon Sep 17 00:00:00 2001 From: harrli Date: Tue, 23 Jan 2024 22:44:31 -0800 Subject: [PATCH 1/8] Replicate http issue --- azurecontainerapps.ts | 4 ++-- src/ContainerAppHelper.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index df336b8..c01afba 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -606,12 +606,12 @@ export class azurecontainerapps { } const environmentVariables: string = this.toolHelper.getInput('environmentVariables', false); - + const cappUpdateCommandUsed: boolean = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided) // Add user-specified environment variables if (!this.util.isNullOrEmpty(environmentVariables)) { // The --replace-env-vars flag is only used for the 'update' command, // otherwise --env-vars is used for 'create' and 'up' - if (this.noIngressUpdate) { + if (cappUpdateCommandUsed) { this.commandLineArgs.push(`--replace-env-vars ${environmentVariables}`); } else { this.commandLineArgs.push(`--env-vars ${environmentVariables}`); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index e52b5de..e28b1c3 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -38,6 +38,7 @@ export class ContainerAppHelper { optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; }); + toolHelper.writeInfo(`Running create command: ${command}`); await util.execute(command); } catch (err) { toolHelper.writeError(err.message); From 068afad526b61f3d1bd773ab272ec6aa63c1c48d Mon Sep 17 00:00:00 2001 From: harrli Date: Tue, 23 Jan 2024 22:47:12 -0800 Subject: [PATCH 2/8] Added built proj files --- dist/index.js | 196 +++++++++++++++++++++++++------------------------- 1 file changed, 99 insertions(+), 97 deletions(-) diff --git a/dist/index.js b/dist/index.js index 07e2928..970c82c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 5871: +/***/ 7272: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -46,11 +46,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.azurecontainerapps = void 0; var fs = __nccwpck_require__(7147); var path = __nccwpck_require__(1017); -var ContainerAppHelper_1 = __nccwpck_require__(232); -var ContainerRegistryHelper_1 = __nccwpck_require__(8053); -var TelemetryHelper_1 = __nccwpck_require__(2036); -var Utility_1 = __nccwpck_require__(1420); -var GitHubActionsToolHelper_1 = __nccwpck_require__(9106); +var ContainerAppHelper_1 = __nccwpck_require__(892); +var ContainerRegistryHelper_1 = __nccwpck_require__(581); +var TelemetryHelper_1 = __nccwpck_require__(7169); +var Utility_1 = __nccwpck_require__(2123); +var GitHubActionsToolHelper_1 = __nccwpck_require__(9980); var buildArgumentRegex = /"[^"]*"|\S+/g; var buildpackEnvironmentNameRegex = /^"?(BP|ORYX)_[-._a-zA-Z0-9]+"?$/; var azurecontainerapps = /** @class */ (function () { @@ -690,11 +690,12 @@ var azurecontainerapps = /** @class */ (function () { } } var environmentVariables = this.toolHelper.getInput('environmentVariables', false); + var cappUpdateCommandUsed = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided); // Add user-specified environment variables if (!this.util.isNullOrEmpty(environmentVariables)) { // The --replace-env-vars flag is only used for the 'update' command, // otherwise --env-vars is used for 'create' and 'up' - if (this.noIngressUpdate) { + if (cappUpdateCommandUsed) { this.commandLineArgs.push("--replace-env-vars ".concat(environmentVariables)); } else { @@ -805,7 +806,7 @@ azurecontainerapps.runMain(); /***/ }), -/***/ 5964: +/***/ 6538: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -832,7 +833,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; const os = __importStar(__nccwpck_require__(2037)); -const utils_1 = __nccwpck_require__(1901); +const utils_1 = __nccwpck_require__(7709); /** * Commands * @@ -904,7 +905,7 @@ function escapeProperty(s) { /***/ }), -/***/ 9095: +/***/ 1006: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -939,12 +940,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(5964); -const file_command_1 = __nccwpck_require__(1234); -const utils_1 = __nccwpck_require__(1901); +const command_1 = __nccwpck_require__(6538); +const file_command_1 = __nccwpck_require__(8549); +const utils_1 = __nccwpck_require__(7709); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(2541); +const oidc_utils_1 = __nccwpck_require__(7307); /** * The code to exit an action */ @@ -1229,17 +1230,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(957); +var summary_1 = __nccwpck_require__(5962); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(957); +var summary_2 = __nccwpck_require__(5962); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(7671); +var path_utils_1 = __nccwpck_require__(7081); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -1247,7 +1248,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 1234: +/***/ 8549: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1278,8 +1279,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(7147)); const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(2372); -const utils_1 = __nccwpck_require__(1901); +const uuid_1 = __nccwpck_require__(3328); +const utils_1 = __nccwpck_require__(7709); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -1312,7 +1313,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 2541: +/***/ 7307: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1328,9 +1329,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(9123); -const auth_1 = __nccwpck_require__(3432); -const core_1 = __nccwpck_require__(9095); +const http_client_1 = __nccwpck_require__(1525); +const auth_1 = __nccwpck_require__(988); +const core_1 = __nccwpck_require__(1006); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -1396,7 +1397,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 7671: +/***/ 7081: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1461,7 +1462,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 957: +/***/ 5962: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1751,7 +1752,7 @@ exports.summary = _summary; /***/ }), -/***/ 1901: +/***/ 7709: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1798,7 +1799,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 4579: +/***/ 2803: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1834,7 +1835,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; const string_decoder_1 = __nccwpck_require__(1576); -const tr = __importStar(__nccwpck_require__(1052)); +const tr = __importStar(__nccwpck_require__(7732)); /** * Exec a command. * Output will be streamed to the live console. @@ -1908,7 +1909,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 1052: +/***/ 7732: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1947,8 +1948,8 @@ const os = __importStar(__nccwpck_require__(2037)); const events = __importStar(__nccwpck_require__(2361)); const child = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const io = __importStar(__nccwpck_require__(7879)); -const ioUtil = __importStar(__nccwpck_require__(6768)); +const io = __importStar(__nccwpck_require__(2771)); +const ioUtil = __importStar(__nccwpck_require__(5555)); const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; @@ -2533,7 +2534,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 3432: +/***/ 988: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2621,7 +2622,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 9123: +/***/ 1525: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2659,8 +2660,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(3685)); const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(2432)); -const tunnel = __importStar(__nccwpck_require__(4775)); +const pm = __importStar(__nccwpck_require__(9251)); +const tunnel = __importStar(__nccwpck_require__(8156)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -3246,7 +3247,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 2432: +/***/ 9251: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3335,7 +3336,7 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 6768: +/***/ 5555: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3525,7 +3526,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 7879: +/***/ 2771: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3562,7 +3563,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(9491); const path = __importStar(__nccwpck_require__(1017)); -const ioUtil = __importStar(__nccwpck_require__(6768)); +const ioUtil = __importStar(__nccwpck_require__(5555)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -3831,15 +3832,15 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 4775: +/***/ 8156: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(308); +module.exports = __nccwpck_require__(1978); /***/ }), -/***/ 308: +/***/ 1978: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4111,7 +4112,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 2372: +/***/ 3328: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4175,29 +4176,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(1679)); +var _v = _interopRequireDefault(__nccwpck_require__(1042)); -var _v2 = _interopRequireDefault(__nccwpck_require__(1555)); +var _v2 = _interopRequireDefault(__nccwpck_require__(3760)); -var _v3 = _interopRequireDefault(__nccwpck_require__(2840)); +var _v3 = _interopRequireDefault(__nccwpck_require__(6277)); -var _v4 = _interopRequireDefault(__nccwpck_require__(7554)); +var _v4 = _interopRequireDefault(__nccwpck_require__(8821)); -var _nil = _interopRequireDefault(__nccwpck_require__(9300)); +var _nil = _interopRequireDefault(__nccwpck_require__(8636)); -var _version = _interopRequireDefault(__nccwpck_require__(7167)); +var _version = _interopRequireDefault(__nccwpck_require__(3869)); -var _validate = _interopRequireDefault(__nccwpck_require__(1604)); +var _validate = _interopRequireDefault(__nccwpck_require__(4593)); -var _stringify = _interopRequireDefault(__nccwpck_require__(1887)); +var _stringify = _interopRequireDefault(__nccwpck_require__(335)); -var _parse = _interopRequireDefault(__nccwpck_require__(5742)); +var _parse = _interopRequireDefault(__nccwpck_require__(280)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 784: +/***/ 9892: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4227,7 +4228,7 @@ exports["default"] = _default; /***/ }), -/***/ 9300: +/***/ 8636: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4242,7 +4243,7 @@ exports["default"] = _default; /***/ }), -/***/ 5742: +/***/ 280: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4253,7 +4254,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1604)); +var _validate = _interopRequireDefault(__nccwpck_require__(4593)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4294,7 +4295,7 @@ exports["default"] = _default; /***/ }), -/***/ 922: +/***/ 6919: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4309,7 +4310,7 @@ exports["default"] = _default; /***/ }), -/***/ 8558: +/***/ 6788: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4340,7 +4341,7 @@ function rng() { /***/ }), -/***/ 3613: +/***/ 6870: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4370,7 +4371,7 @@ exports["default"] = _default; /***/ }), -/***/ 1887: +/***/ 335: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4381,7 +4382,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1604)); +var _validate = _interopRequireDefault(__nccwpck_require__(4593)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4416,7 +4417,7 @@ exports["default"] = _default; /***/ }), -/***/ 1679: +/***/ 1042: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4427,9 +4428,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(8558)); +var _rng = _interopRequireDefault(__nccwpck_require__(6788)); -var _stringify = _interopRequireDefault(__nccwpck_require__(1887)); +var _stringify = _interopRequireDefault(__nccwpck_require__(335)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4530,7 +4531,7 @@ exports["default"] = _default; /***/ }), -/***/ 1555: +/***/ 3760: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4541,9 +4542,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(909)); +var _v = _interopRequireDefault(__nccwpck_require__(3053)); -var _md = _interopRequireDefault(__nccwpck_require__(784)); +var _md = _interopRequireDefault(__nccwpck_require__(9892)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4553,7 +4554,7 @@ exports["default"] = _default; /***/ }), -/***/ 909: +/***/ 3053: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4565,9 +4566,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(1887)); +var _stringify = _interopRequireDefault(__nccwpck_require__(335)); -var _parse = _interopRequireDefault(__nccwpck_require__(5742)); +var _parse = _interopRequireDefault(__nccwpck_require__(280)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4638,7 +4639,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 2840: +/***/ 6277: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4649,9 +4650,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(8558)); +var _rng = _interopRequireDefault(__nccwpck_require__(6788)); -var _stringify = _interopRequireDefault(__nccwpck_require__(1887)); +var _stringify = _interopRequireDefault(__nccwpck_require__(335)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4682,7 +4683,7 @@ exports["default"] = _default; /***/ }), -/***/ 7554: +/***/ 8821: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4693,9 +4694,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(909)); +var _v = _interopRequireDefault(__nccwpck_require__(3053)); -var _sha = _interopRequireDefault(__nccwpck_require__(3613)); +var _sha = _interopRequireDefault(__nccwpck_require__(6870)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4705,7 +4706,7 @@ exports["default"] = _default; /***/ }), -/***/ 1604: +/***/ 4593: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4716,7 +4717,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(922)); +var _regex = _interopRequireDefault(__nccwpck_require__(6919)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4729,7 +4730,7 @@ exports["default"] = _default; /***/ }), -/***/ 7167: +/***/ 3869: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4740,7 +4741,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1604)); +var _validate = _interopRequireDefault(__nccwpck_require__(4593)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4757,7 +4758,7 @@ exports["default"] = _default; /***/ }), -/***/ 232: +/***/ 892: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4802,8 +4803,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContainerAppHelper = void 0; var path = __nccwpck_require__(1017); var os = __nccwpck_require__(2037); -var Utility_1 = __nccwpck_require__(1420); -var GitHubActionsToolHelper_1 = __nccwpck_require__(9106); +var Utility_1 = __nccwpck_require__(2123); +var GitHubActionsToolHelper_1 = __nccwpck_require__(9980); var fs = __nccwpck_require__(7147); var ORYX_CLI_IMAGE = 'mcr.microsoft.com/oryx/cli:builder-debian-bullseye-20230926.1'; var ORYX_BULLSEYE_BUILDER_IMAGE = 'mcr.microsoft.com/oryx/builder:debian-bullseye-20231107.2'; @@ -4839,6 +4840,7 @@ var ContainerAppHelper = /** @class */ (function () { optionalCmdArgs.forEach(function (val) { command_1 += " ".concat(val); }); + toolHelper.writeInfo("Running create command: ".concat(command_1)); return [4 /*yield*/, util.execute(command_1)]; case 2: _a.sent(); @@ -5645,7 +5647,7 @@ exports.ContainerAppHelper = ContainerAppHelper; /***/ }), -/***/ 8053: +/***/ 581: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5689,8 +5691,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContainerRegistryHelper = void 0; var os = __nccwpck_require__(2037); -var Utility_1 = __nccwpck_require__(1420); -var GitHubActionsToolHelper_1 = __nccwpck_require__(9106); +var Utility_1 = __nccwpck_require__(2123); +var GitHubActionsToolHelper_1 = __nccwpck_require__(9980); var toolHelper = new GitHubActionsToolHelper_1.GitHubActionsToolHelper(); var util = new Utility_1.Utility(); var ContainerRegistryHelper = /** @class */ (function () { @@ -5788,7 +5790,7 @@ exports.ContainerRegistryHelper = ContainerRegistryHelper; /***/ }), -/***/ 9106: +/***/ 9980: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5831,9 +5833,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GitHubActionsToolHelper = void 0; -var core = __nccwpck_require__(9095); -var io = __nccwpck_require__(7879); -var exec = __nccwpck_require__(4579); +var core = __nccwpck_require__(1006); +var io = __nccwpck_require__(2771); +var exec = __nccwpck_require__(2803); var GitHubActionsToolHelper = /** @class */ (function () { function GitHubActionsToolHelper() { } @@ -5929,7 +5931,7 @@ exports.GitHubActionsToolHelper = GitHubActionsToolHelper; /***/ }), -/***/ 2036: +/***/ 7169: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5972,8 +5974,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TelemetryHelper = void 0; -var Utility_1 = __nccwpck_require__(1420); -var GitHubActionsToolHelper_1 = __nccwpck_require__(9106); +var Utility_1 = __nccwpck_require__(2123); +var GitHubActionsToolHelper_1 = __nccwpck_require__(9980); var ORYX_CLI_IMAGE = "mcr.microsoft.com/oryx/cli:debian-buster-20230207.2"; var SUCCESSFUL_RESULT = "succeeded"; var FAILED_RESULT = "failed"; @@ -6066,7 +6068,7 @@ exports.TelemetryHelper = TelemetryHelper; /***/ }), -/***/ 1420: +/***/ 2123: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -6110,7 +6112,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Utility = void 0; // Note: This file is used to define utility functions that can be used across the project. -var GitHubActionsToolHelper_1 = __nccwpck_require__(9106); +var GitHubActionsToolHelper_1 = __nccwpck_require__(9980); var toolHelper = new GitHubActionsToolHelper_1.GitHubActionsToolHelper(); var Utility = /** @class */ (function () { function Utility() { @@ -6314,7 +6316,7 @@ module.exports = require("util"); /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(5871); +/******/ var __webpack_exports__ = __nccwpck_require__(7272); /******/ module.exports = __webpack_exports__; /******/ /******/ })() From adeb8626e3fadd676fc989337082ace92824f255 Mon Sep 17 00:00:00 2001 From: harrli Date: Tue, 23 Jan 2024 23:14:02 -0800 Subject: [PATCH 3/8] Add --debug flag to create command in ContainerAppHelper.ts --- dist/index.js | 3 +-- src/ContainerAppHelper.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 970c82c..ba963f6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4836,11 +4836,10 @@ var ContainerAppHelper = /** @class */ (function () { _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none"); + command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none --debug"); optionalCmdArgs.forEach(function (val) { command_1 += " ".concat(val); }); - toolHelper.writeInfo("Running create command: ".concat(command_1)); return [4 /*yield*/, util.execute(command_1)]; case 2: _a.sent(); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index e28b1c3..4827956 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -34,11 +34,10 @@ export class ContainerAppHelper { optionalCmdArgs: string[]) { toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}"`); try { - let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none`; + let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none --debug`; optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; }); - toolHelper.writeInfo(`Running create command: ${command}`); await util.execute(command); } catch (err) { toolHelper.writeError(err.message); From f13456737888eaa61f4b683edcc4bafc3c9c772b Mon Sep 17 00:00:00 2001 From: harrli Date: Wed, 24 Jan 2024 11:17:56 -0800 Subject: [PATCH 4/8] Removed any possible line breaks in env name --- azurecontainerapps.ts | 2 +- dist/index.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index c01afba..588a53b 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -362,7 +362,7 @@ export class azurecontainerapps { if (!containerAppEnvironmentExists) { await this.appHelper.createContainerAppEnvironment(containerAppEnvironment, resourceGroup, location); } - + containerAppEnvironment = containerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); return containerAppEnvironment; } diff --git a/dist/index.js b/dist/index.js index ba963f6..2b5dc28 100644 --- a/dist/index.js +++ b/dist/index.js @@ -417,7 +417,9 @@ var azurecontainerapps = /** @class */ (function () { case 4: _a.sent(); _a.label = 5; - case 5: return [2 /*return*/, containerAppEnvironment]; + case 5: + containerAppEnvironment = containerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); + return [2 /*return*/, containerAppEnvironment]; } }); }); From 8466af4438d104bbb0e31161d5b7794391049fce Mon Sep 17 00:00:00 2001 From: harrli Date: Wed, 24 Jan 2024 11:30:39 -0800 Subject: [PATCH 5/8] Added sanity check on existing env names --- azurecontainerapps.ts | 3 ++- dist/index.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 588a53b..ff5cc81 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -344,9 +344,10 @@ export class azurecontainerapps { // See if we can reuse an existing Container App environment found in the resource group if (this.util.isNullOrEmpty(containerAppEnvironment)) { - const existingContainerAppEnvironment: string = await this.appHelper.getExistingContainerAppEnvironment(resourceGroup); + let existingContainerAppEnvironment: string = await this.appHelper.getExistingContainerAppEnvironment(resourceGroup); if (!this.util.isNullOrEmpty(existingContainerAppEnvironment)) { this.toolHelper.writeInfo(`Existing Container App environment found in resource group: ${existingContainerAppEnvironment}`); + existingContainerAppEnvironment = existingContainerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); return existingContainerAppEnvironment } } diff --git a/dist/index.js b/dist/index.js index 2b5dc28..f874de4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -400,6 +400,7 @@ var azurecontainerapps = /** @class */ (function () { existingContainerAppEnvironment = _a.sent(); if (!this.util.isNullOrEmpty(existingContainerAppEnvironment)) { this.toolHelper.writeInfo("Existing Container App environment found in resource group: ".concat(existingContainerAppEnvironment)); + existingContainerAppEnvironment = existingContainerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); return [2 /*return*/, existingContainerAppEnvironment]; } _a.label = 2; From 93284c986b83aac63a6fc74bd7bad47376c3ef05 Mon Sep 17 00:00:00 2001 From: harrli Date: Wed, 24 Jan 2024 13:17:14 -0800 Subject: [PATCH 6/8] Refactored env name sanity check --- azurecontainerapps.ts | 9 ++++----- dist/index.js | 11 ++++------- src/ContainerAppHelper.ts | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index ff5cc81..456ee34 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -344,10 +344,9 @@ export class azurecontainerapps { // See if we can reuse an existing Container App environment found in the resource group if (this.util.isNullOrEmpty(containerAppEnvironment)) { - let existingContainerAppEnvironment: string = await this.appHelper.getExistingContainerAppEnvironment(resourceGroup); + const existingContainerAppEnvironment: string = await this.appHelper.getExistingContainerAppEnvironment(resourceGroup); if (!this.util.isNullOrEmpty(existingContainerAppEnvironment)) { this.toolHelper.writeInfo(`Existing Container App environment found in resource group: ${existingContainerAppEnvironment}`); - existingContainerAppEnvironment = existingContainerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); return existingContainerAppEnvironment } } @@ -363,7 +362,7 @@ export class azurecontainerapps { if (!containerAppEnvironmentExists) { await this.appHelper.createContainerAppEnvironment(containerAppEnvironment, resourceGroup, location); } - containerAppEnvironment = containerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); + return containerAppEnvironment; } @@ -607,12 +606,12 @@ export class azurecontainerapps { } const environmentVariables: string = this.toolHelper.getInput('environmentVariables', false); - const cappUpdateCommandUsed: boolean = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided) + const isCappUpdateCommandUsed: boolean = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided) // Add user-specified environment variables if (!this.util.isNullOrEmpty(environmentVariables)) { // The --replace-env-vars flag is only used for the 'update' command, // otherwise --env-vars is used for 'create' and 'up' - if (cappUpdateCommandUsed) { + if (isCappUpdateCommandUsed) { this.commandLineArgs.push(`--replace-env-vars ${environmentVariables}`); } else { this.commandLineArgs.push(`--env-vars ${environmentVariables}`); diff --git a/dist/index.js b/dist/index.js index f874de4..6a96632 100644 --- a/dist/index.js +++ b/dist/index.js @@ -400,7 +400,6 @@ var azurecontainerapps = /** @class */ (function () { existingContainerAppEnvironment = _a.sent(); if (!this.util.isNullOrEmpty(existingContainerAppEnvironment)) { this.toolHelper.writeInfo("Existing Container App environment found in resource group: ".concat(existingContainerAppEnvironment)); - existingContainerAppEnvironment = existingContainerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); return [2 /*return*/, existingContainerAppEnvironment]; } _a.label = 2; @@ -418,9 +417,7 @@ var azurecontainerapps = /** @class */ (function () { case 4: _a.sent(); _a.label = 5; - case 5: - containerAppEnvironment = containerAppEnvironment.replace(/(\r\n|\n|\r)/gm, ""); - return [2 /*return*/, containerAppEnvironment]; + case 5: return [2 /*return*/, containerAppEnvironment]; } }); }); @@ -693,12 +690,12 @@ var azurecontainerapps = /** @class */ (function () { } } var environmentVariables = this.toolHelper.getInput('environmentVariables', false); - var cappUpdateCommandUsed = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided); + var isCappUpdateCommandUsed = this.noIngressUpdate || (!this.noIngressUpdate && !this.adminCredentialsProvided); // Add user-specified environment variables if (!this.util.isNullOrEmpty(environmentVariables)) { // The --replace-env-vars flag is only used for the 'update' command, // otherwise --env-vars is used for 'create' and 'up' - if (cappUpdateCommandUsed) { + if (isCappUpdateCommandUsed) { this.commandLineArgs.push("--replace-env-vars ".concat(environmentVariables)); } else { @@ -5226,7 +5223,7 @@ var ContainerAppHelper = /** @class */ (function () { return [4 /*yield*/, util.execute(command)]; case 2: executionResult = _a.sent(); - return [2 /*return*/, executionResult.exitCode === 0 ? executionResult.stdout : null]; + return [2 /*return*/, executionResult.exitCode === 0 ? executionResult.stdout.replace(/(\r\n|\n|\r)/gm, "") : null]; case 3: err_13 = _a.sent(); toolHelper.writeInfo(err_13.message); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index 4827956..eab4fcd 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -293,7 +293,7 @@ export class ContainerAppHelper { try { let command = `az containerapp env list -g ${resourceGroup} --query "[0].name"` let executionResult = await util.execute(command); - return executionResult.exitCode === 0 ? executionResult.stdout : null; + return executionResult.exitCode === 0 ? executionResult.stdout.replace(/(\r\n|\n|\r)/gm, "") : null; } catch (err) { toolHelper.writeInfo(err.message); return null; From 74997132c68ec931897b76b5e17c8236d158c7fa Mon Sep 17 00:00:00 2001 From: harrli Date: Wed, 24 Jan 2024 13:21:42 -0800 Subject: [PATCH 7/8] Removed debug option --- dist/index.js | 2 +- src/ContainerAppHelper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6a96632..e67fe97 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4836,7 +4836,7 @@ var ContainerAppHelper = /** @class */ (function () { _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none --debug"); + command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none"); optionalCmdArgs.forEach(function (val) { command_1 += " ".concat(val); }); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index eab4fcd..b4b7721 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -34,7 +34,7 @@ export class ContainerAppHelper { optionalCmdArgs: string[]) { toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}"`); try { - let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none --debug`; + let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none`; optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; }); From 5c50e38adf9d66f3138ecce32cb86071289a9a63 Mon Sep 17 00:00:00 2001 From: harrli Date: Wed, 24 Jan 2024 13:49:24 -0800 Subject: [PATCH 8/8] Addressed comments --- dist/index.js | 4 ++-- src/ContainerAppHelper.ts | 2 +- src/GithubActionsToolHelper.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index e67fe97..c5be4d7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5223,7 +5223,7 @@ var ContainerAppHelper = /** @class */ (function () { return [4 /*yield*/, util.execute(command)]; case 2: executionResult = _a.sent(); - return [2 /*return*/, executionResult.exitCode === 0 ? executionResult.stdout.replace(/(\r\n|\n|\r)/gm, "") : null]; + return [2 /*return*/, executionResult.exitCode === 0 ? executionResult.stdout : null]; case 3: err_13 = _a.sent(); toolHelper.writeInfo(err_13.message); @@ -5868,7 +5868,7 @@ var GitHubActionsToolHelper = /** @class */ (function () { options = { listeners: { stdout: function (data) { - stdout_1 += data.toString(); + stdout_1 += data.toString().replace(/(\r\n|\n|\r)/gm, ""); }, stderr: function (data) { stderr_1 += data.toString(); diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index b4b7721..e52b5de 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -293,7 +293,7 @@ export class ContainerAppHelper { try { let command = `az containerapp env list -g ${resourceGroup} --query "[0].name"` let executionResult = await util.execute(command); - return executionResult.exitCode === 0 ? executionResult.stdout.replace(/(\r\n|\n|\r)/gm, "") : null; + return executionResult.exitCode === 0 ? executionResult.stdout : null; } catch (err) { toolHelper.writeInfo(err.message); return null; diff --git a/src/GithubActionsToolHelper.ts b/src/GithubActionsToolHelper.ts index 8dcfa03..0d231aa 100644 --- a/src/GithubActionsToolHelper.ts +++ b/src/GithubActionsToolHelper.ts @@ -36,7 +36,7 @@ export class GitHubActionsToolHelper { const options: exec.ExecOptions = { listeners: { stdout: (data: Buffer) => { - stdout += data.toString(); + stdout += data.toString().replace(/(\r\n|\n|\r)/gm, ""); }, stderr: (data: Buffer) => { stderr += data.toString();