Skip to content

Commit

Permalink
Refactor telemetry and trigger pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
snehapar9 committed Sep 25, 2023
1 parent df7c5db commit 293186c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5538,17 +5538,17 @@ var TelemetryHelper = /** @class */ (function () {
_a.trys.push([1, 3, , 4]);
resultArg = '';
if (!util.isNullOrEmpty(this.result)) {
resultArg = "--property 'result=" + this.result + "'";
resultArg = "--property result=" + this.result;
}
scenarioArg = '';
if (!util.isNullOrEmpty(this.scenario)) {
scenarioArg = "--property 'scenario=" + this.scenario + "'";
scenarioArg = "--property scenario=" + this.scenario;
}
errorMessageArg = '';
if (!util.isNullOrEmpty(this.errorMessage)) {
errorMessageArg = "--property 'errorMessage=" + this.errorMessage + "'";
errorMessageArg = "--property errorMessage=" + this.errorMessage;
}
args = ["run", "--rm", "" + ORYX_CLI_IMAGE, "/bin/bash", "-c", "oryx telemetry --event-name 'ContainerAppsGitHubActionV1' " + ("--processing-time '" + taskLengthMilliseconds + "' " + resultArg + " " + scenarioArg + " " + errorMessageArg + "\"")];
args = ["run", "--rm", "" + ORYX_CLI_IMAGE, "/bin/bash", "-c", "oryx telemetry --event-name ContainerAppsGitHubActionV1 " + ("--processing-time " + taskLengthMilliseconds + " " + resultArg + " " + scenarioArg + " " + errorMessageArg + "\"")];
return [4 /*yield*/, executeDockerCommand(args, true)];
case 2:
_a.sent();
Expand Down
8 changes: 4 additions & 4 deletions src/TelemetryHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ export class TelemetryHelper {
try {
let resultArg: string = '';
if (!util.isNullOrEmpty(this.result)) {
resultArg = `--property 'result=${this.result}'`;
resultArg = `--property result=${this.result}`;
}

let scenarioArg: string = '';
if (!util.isNullOrEmpty(this.scenario)) {
scenarioArg = `--property 'scenario=${this.scenario}'`;
scenarioArg = `--property scenario=${this.scenario}`;
}

let errorMessageArg: string = '';
if (!util.isNullOrEmpty(this.errorMessage)) {
errorMessageArg = `--property 'errorMessage=${this.errorMessage}'`;
errorMessageArg = `--property errorMessage=${this.errorMessage}`;
}

let args: string[] = [`run`, `--rm`, `${ORYX_CLI_IMAGE}`, `/bin/bash`, `-c`, `oryx telemetry --event-name 'ContainerAppsGitHubActionV1' ` + `--processing-time '${taskLengthMilliseconds}' ${resultArg} ${scenarioArg} ${errorMessageArg}"`];
let args: string[] = [`run`, `--rm`, `${ORYX_CLI_IMAGE}`, `/bin/bash`, `-c`, `oryx telemetry --event-name ContainerAppsGitHubActionV1 ` + `--processing-time ${taskLengthMilliseconds} ${resultArg} ${scenarioArg} ${errorMessageArg}"`];

await executeDockerCommand(args, true)
} catch (err) {
Expand Down

0 comments on commit 293186c

Please sign in to comment.