Refactor CLI/cleanup
parent
bd731a540a
commit
b4618a7e68
|
|
@ -428,21 +428,6 @@ class CLI {
|
||||||
exports.CLI = CLI;
|
exports.CLI = CLI;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 52818:
|
|
||||||
/***/ ((__unused_webpack_module, exports) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
||||||
exports.CloudRunnerClientStatics = void 0;
|
|
||||||
class CloudRunnerClientStatics {
|
|
||||||
}
|
|
||||||
exports.CloudRunnerClientStatics = CloudRunnerClientStatics;
|
|
||||||
CloudRunnerClientStatics.logPrefix = `Cloud-Runner-Client`;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 74462:
|
/***/ 74462:
|
||||||
|
|
@ -892,7 +877,7 @@ const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||||
const __1 = __webpack_require__(41359);
|
const __1 = __webpack_require__(41359);
|
||||||
const fs_1 = __importDefault(__webpack_require__(35747));
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
||||||
const cloud_runner_state_1 = __webpack_require__(70912);
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
||||||
const cloud_runner_client_statics_1 = __webpack_require__(52818);
|
const cloud_runner_statics_1 = __webpack_require__(90828);
|
||||||
class AWSBuildRunner {
|
class AWSBuildRunner {
|
||||||
static runTask(taskDef, ECS, CF, environment, buildGuid, commands) {
|
static runTask(taskDef, ECS, CF, environment, buildGuid, commands) {
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
||||||
|
|
@ -1024,7 +1009,7 @@ class AWSBuildRunner {
|
||||||
else if (message.includes('Rebuilding Library because the asset database could not be found!')) {
|
else if (message.includes('Rebuilding Library because the asset database could not be found!')) {
|
||||||
core.warning('LIBRARY NOT FOUND!');
|
core.warning('LIBRARY NOT FOUND!');
|
||||||
}
|
}
|
||||||
message = `[${cloud_runner_client_statics_1.CloudRunnerClientStatics.logPrefix}] ${message}`;
|
message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`;
|
||||||
if (cloud_runner_state_1.CloudRunnerState.buildParams.logToFile) {
|
if (cloud_runner_state_1.CloudRunnerState.buildParams.logToFile) {
|
||||||
fs_1.default.appendFileSync(`${cloud_runner_state_1.CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
fs_1.default.appendFileSync(`${cloud_runner_state_1.CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
||||||
}
|
}
|
||||||
|
|
@ -1497,6 +1482,21 @@ class AWSBuildEnvironment {
|
||||||
exports.default = AWSBuildEnvironment;
|
exports.default = AWSBuildEnvironment;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 90828:
|
||||||
|
/***/ ((__unused_webpack_module, exports) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.CloudRunnerStatics = void 0;
|
||||||
|
class CloudRunnerStatics {
|
||||||
|
}
|
||||||
|
exports.CloudRunnerStatics = CloudRunnerStatics;
|
||||||
|
CloudRunnerStatics.logPrefix = `Cloud-Runner-Agent`;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 79144:
|
/***/ 79144:
|
||||||
|
|
@ -1950,7 +1950,7 @@ const stream_1 = __webpack_require__(92413);
|
||||||
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||||
const cloud_runner_state_1 = __webpack_require__(70912);
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
||||||
const fs_1 = __importDefault(__webpack_require__(35747));
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
||||||
const cloud_runner_client_statics_1 = __webpack_require__(52818);
|
const cloud_runner_statics_1 = __webpack_require__(90828);
|
||||||
class KubernetesLogging {
|
class KubernetesLogging {
|
||||||
static streamLogs(kubeConfig, kubeClient, jobName, podName, containerName, namespace, logCallback) {
|
static streamLogs(kubeConfig, kubeClient, jobName, podName, containerName, namespace, logCallback) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
|
@ -1960,7 +1960,7 @@ class KubernetesLogging {
|
||||||
stream._write = (chunk, encoding, next) => {
|
stream._write = (chunk, encoding, next) => {
|
||||||
didStreamAnyLogs = true;
|
didStreamAnyLogs = true;
|
||||||
let message = chunk.toString();
|
let message = chunk.toString();
|
||||||
message = `[${cloud_runner_client_statics_1.CloudRunnerClientStatics.logPrefix}] ${message}`;
|
message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`;
|
||||||
if (cloud_runner_state_1.CloudRunnerState.buildParams.logToFile) {
|
if (cloud_runner_state_1.CloudRunnerState.buildParams.logToFile) {
|
||||||
fs_1.default.appendFileSync(`${cloud_runner_state_1.CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
fs_1.default.appendFileSync(`${cloud_runner_state_1.CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
||||||
}
|
}
|
||||||
|
|
@ -2372,7 +2372,7 @@ class CloudRunnerLogger {
|
||||||
core.info(message);
|
core.info(message);
|
||||||
}
|
}
|
||||||
static logRemoteCli(message) {
|
static logRemoteCli(message) {
|
||||||
CloudRunnerLogger.log(`[Remote-Cli] ${message}`);
|
CloudRunnerLogger.log(`[Remote-Client] ${message}`);
|
||||||
}
|
}
|
||||||
static logLine(message) {
|
static logLine(message) {
|
||||||
core.info(`${message}\n`);
|
core.info(`${message}\n`);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +0,0 @@
|
||||||
export class CloudRunnerClientStatics {
|
|
||||||
public static readonly logPrefix = `Cloud-Runner-Client`;
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,7 @@ import CloudRunnerLogger from '../services/cloud-runner-logger';
|
||||||
import { Input } from '../..';
|
import { Input } from '../..';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { CloudRunnerState } from '../state/cloud-runner-state';
|
import { CloudRunnerState } from '../state/cloud-runner-state';
|
||||||
import { CloudRunnerClientStatics } from '../../cli/cloud-runner-client/cloud-runner-client-statics';
|
import { CloudRunnerStatics } from '../cloud-runner-statics';
|
||||||
|
|
||||||
class AWSBuildRunner {
|
class AWSBuildRunner {
|
||||||
static async runTask(
|
static async runTask(
|
||||||
|
|
@ -179,7 +179,7 @@ class AWSBuildRunner {
|
||||||
} else if (message.includes('Rebuilding Library because the asset database could not be found!')) {
|
} else if (message.includes('Rebuilding Library because the asset database could not be found!')) {
|
||||||
core.warning('LIBRARY NOT FOUND!');
|
core.warning('LIBRARY NOT FOUND!');
|
||||||
}
|
}
|
||||||
message = `[${CloudRunnerClientStatics.logPrefix}] ${message}`;
|
message = `[${CloudRunnerStatics.logPrefix}] ${message}`;
|
||||||
if (CloudRunnerState.buildParams.logToFile) {
|
if (CloudRunnerState.buildParams.logToFile) {
|
||||||
fs.appendFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
fs.appendFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export class CloudRunnerStatics {
|
||||||
|
public static readonly logPrefix = `Cloud-Runner-Agent`;
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@ import CloudRunner from './cloud-runner';
|
||||||
import Input from '../input';
|
import Input from '../input';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { CloudRunnerState } from './state/cloud-runner-state';
|
import { CloudRunnerState } from './state/cloud-runner-state';
|
||||||
import { CloudRunnerClientStatics } from '../cli/cloud-runner-client/cloud-runner-client-statics';
|
import { CloudRunnerStatics } from './cloud-runner-statics';
|
||||||
|
|
||||||
describe('Cloud Runner', () => {
|
describe('Cloud Runner', () => {
|
||||||
it('responds', () => {});
|
it('responds', () => {});
|
||||||
|
|
@ -37,7 +37,7 @@ describe('Cloud Runner', () => {
|
||||||
for (const element of inputKeys) {
|
for (const element of inputKeys) {
|
||||||
if (Input[element] !== undefined && typeof Input[element] != 'function') {
|
if (Input[element] !== undefined && typeof Input[element] != 'function') {
|
||||||
expect(
|
expect(
|
||||||
file.replace(/\s+/g, '').replace(new RegExp(`\\[${CloudRunnerClientStatics.logPrefix}\\]`, 'g'), ''),
|
file.replace(/\s+/g, '').replace(new RegExp(`\\[${CloudRunnerStatics.logPrefix}\\]`, 'g'), ''),
|
||||||
).toContain(`${element}=${Input[element].toString().replace(/\s+/g, '')}`);
|
).toContain(`${element}=${Input[element].toString().replace(/\s+/g, '')}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Writable } from 'stream';
|
||||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
||||||
import { CloudRunnerState } from '../state/cloud-runner-state';
|
import { CloudRunnerState } from '../state/cloud-runner-state';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { CloudRunnerClientStatics } from '../../cli/cloud-runner-client/cloud-runner-client-statics';
|
import { CloudRunnerStatics } from '../cloud-runner-statics';
|
||||||
class KubernetesLogging {
|
class KubernetesLogging {
|
||||||
static async streamLogs(
|
static async streamLogs(
|
||||||
kubeConfig: KubeConfig,
|
kubeConfig: KubeConfig,
|
||||||
|
|
@ -20,7 +20,7 @@ class KubernetesLogging {
|
||||||
stream._write = (chunk, encoding, next) => {
|
stream._write = (chunk, encoding, next) => {
|
||||||
didStreamAnyLogs = true;
|
didStreamAnyLogs = true;
|
||||||
let message = chunk.toString();
|
let message = chunk.toString();
|
||||||
message = `[${CloudRunnerClientStatics.logPrefix}] ${message}`;
|
message = `[${CloudRunnerStatics.logPrefix}] ${message}`;
|
||||||
if (CloudRunnerState.buildParams.logToFile) {
|
if (CloudRunnerState.buildParams.logToFile) {
|
||||||
fs.appendFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
fs.appendFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, `${message}\r\n`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class CloudRunnerLogger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static logRemoteCli(message: string) {
|
public static logRemoteCli(message: string) {
|
||||||
CloudRunnerLogger.log(`[Remote-Cli] ${message}`);
|
CloudRunnerLogger.log(`[Remote-Client] ${message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static logLine(message: string) {
|
public static logLine(message: string) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue