remove commented code
parent
834491ada2
commit
2173383af8
|
|
@ -856,7 +856,7 @@ class CloudRunnerOptions {
|
||||||
}
|
}
|
||||||
static get watchCloudRunnerToEnd() {
|
static get watchCloudRunnerToEnd() {
|
||||||
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
||||||
return !input || input === 'true';
|
return input === 'true';
|
||||||
}
|
}
|
||||||
static get useSharedLargePackages() {
|
static get useSharedLargePackages() {
|
||||||
return CloudRunnerOptions.getInput(`useSharedLargePackages`) || false;
|
return CloudRunnerOptions.getInput(`useSharedLargePackages`) || false;
|
||||||
|
|
@ -2603,7 +2603,6 @@ class TaskService {
|
||||||
cloud_runner_logger_1.default.log(`Stacks ${stacks.length}`);
|
cloud_runner_logger_1.default.log(`Stacks ${stacks.length}`);
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
// if (verbose)
|
|
||||||
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
||||||
if (perResultCallback)
|
if (perResultCallback)
|
||||||
yield perResultCallback(element);
|
yield perResultCallback(element);
|
||||||
|
|
@ -2612,7 +2611,6 @@ class TaskService {
|
||||||
cloud_runner_logger_1.default.log(`Base Stacks ${baseStacks.length}`);
|
cloud_runner_logger_1.default.log(`Base Stacks ${baseStacks.length}`);
|
||||||
for (const element of baseStacks) {
|
for (const element of baseStacks) {
|
||||||
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
// if (verbose)
|
|
||||||
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
||||||
if (perResultCallback)
|
if (perResultCallback)
|
||||||
yield perResultCallback(element);
|
yield perResultCallback(element);
|
||||||
|
|
@ -2666,7 +2664,6 @@ class TaskService {
|
||||||
cloud_runner_logger_1.default.log(`Stacks ${stacks.length}`);
|
cloud_runner_logger_1.default.log(`Stacks ${stacks.length}`);
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
// if (verbose)
|
|
||||||
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
||||||
if (perResultCallback)
|
if (perResultCallback)
|
||||||
yield perResultCallback(element);
|
yield perResultCallback(element);
|
||||||
|
|
@ -2746,7 +2743,6 @@ class TertiaryResourcesService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const ageDate = new Date(Date.now() - element.creationTime);
|
const ageDate = new Date(Date.now() - element.creationTime);
|
||||||
// if (verbose)
|
|
||||||
cloud_runner_logger_1.default.log(`Task Stack ${element.logGroupName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
cloud_runner_logger_1.default.log(`Task Stack ${element.logGroupName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);
|
||||||
if (perResultCallback)
|
if (perResultCallback)
|
||||||
yield perResultCallback(element, element);
|
yield perResultCallback(element, element);
|
||||||
|
|
@ -5375,8 +5371,6 @@ const cloud_runner_query_override_1 = __importDefault(__nccwpck_require__(31011)
|
||||||
const cloud_runner_options_reader_1 = __importDefault(__nccwpck_require__(3343));
|
const cloud_runner_options_reader_1 = __importDefault(__nccwpck_require__(3343));
|
||||||
const build_parameters_1 = __importDefault(__nccwpck_require__(80787));
|
const build_parameters_1 = __importDefault(__nccwpck_require__(80787));
|
||||||
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
||||||
// import CloudRunner from '../cloud-runner';
|
|
||||||
// import ImageEnvironmentFactory from '../../image-environment-factory';
|
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
class TaskParameterSerializer {
|
class TaskParameterSerializer {
|
||||||
static createCloudRunnerEnvironmentVariables(buildParameters) {
|
static createCloudRunnerEnvironmentVariables(buildParameters) {
|
||||||
|
|
@ -5406,21 +5400,11 @@ class TaskParameterSerializer {
|
||||||
.map((x) => {
|
.map((x) => {
|
||||||
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
||||||
x.value = `${x.value}`;
|
x.value = `${x.value}`;
|
||||||
// if (x.name === `CUSTOM_JOB` || x.name === `GAMECI-CUSTOM_JOB`) {
|
if (buildParameters.cloudRunnerDebug && Number(x.name) === Number.NaN) {
|
||||||
// x.value = base64.encode(x.value);
|
|
||||||
// }
|
|
||||||
if (buildParameters.cloudRunnerDebug) {
|
|
||||||
if (Number(x.name) === Number.NaN) {
|
|
||||||
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// core.info(`${JSON.stringify(x)}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return x;
|
return x;
|
||||||
}), (item) => item.name);
|
}), (item) => item.name);
|
||||||
// core.info(`Serialized Env Vars`);
|
|
||||||
// core.info(JSON.stringify(result, undefined, 4));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
static uniqBy(a, key) {
|
static uniqBy(a, key) {
|
||||||
|
|
@ -5440,12 +5424,8 @@ class TaskParameterSerializer {
|
||||||
for (const element of keys) {
|
for (const element of keys) {
|
||||||
if (element !== `customJob`) {
|
if (element !== `customJob`) {
|
||||||
buildParameters[element] = process.env[`GAMECI_${TaskParameterSerializer.ToEnvVarFormat(element)}`];
|
buildParameters[element] = process.env[`GAMECI_${TaskParameterSerializer.ToEnvVarFormat(element)}`];
|
||||||
// buildParameters[element] = base64.decode(buildParameters[element]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (JSON.stringify(buildParameters) === JSON.stringify({})) {
|
|
||||||
// throw new Error(`Build parameters from environment are empty`);
|
|
||||||
// }
|
|
||||||
return buildParameters;
|
return buildParameters;
|
||||||
}
|
}
|
||||||
static readInput() {
|
static readInput() {
|
||||||
|
|
@ -5476,7 +5456,6 @@ class TaskParameterSerializer {
|
||||||
value: buildParameters[element],
|
value: buildParameters[element],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// core.info(JSON.stringify(array, undefined, 4));
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
static serializeFromType(type) {
|
static serializeFromType(type) {
|
||||||
|
|
@ -5498,17 +5477,6 @@ class TaskParameterSerializer {
|
||||||
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_EMAIL');
|
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_EMAIL');
|
||||||
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
||||||
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_LICENSE');
|
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_LICENSE');
|
||||||
// array.push(
|
|
||||||
// ...ImageEnvironmentFactory.getEnvironmentVariables(CloudRunner.buildParameters)
|
|
||||||
// .filter((x) => array.every((y) => y.ParameterKey !== x.name))
|
|
||||||
// .map((x) => {
|
|
||||||
// return {
|
|
||||||
// ParameterKey: x.name,
|
|
||||||
// EnvironmentVariable: x.name,
|
|
||||||
// ParameterValue: x.value,
|
|
||||||
// };
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
static getValue(key) {
|
static getValue(key) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -222,7 +222,7 @@ class CloudRunnerOptions {
|
||||||
static get watchCloudRunnerToEnd(): boolean {
|
static get watchCloudRunnerToEnd(): boolean {
|
||||||
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
const input = CloudRunnerOptions.getInput(`watchToEnd`);
|
||||||
|
|
||||||
return !input || input === 'true';
|
return input === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static get useSharedLargePackages(): boolean {
|
public static get useSharedLargePackages(): boolean {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ export class TaskService {
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
|
|
||||||
// if (verbose)
|
|
||||||
CloudRunnerLogger.log(
|
CloudRunnerLogger.log(
|
||||||
`Task Stack ${element.StackName} - Age D${Math.floor(
|
`Task Stack ${element.StackName} - Age D${Math.floor(
|
||||||
ageDate.getHours() / 24,
|
ageDate.getHours() / 24,
|
||||||
|
|
@ -44,7 +43,6 @@ export class TaskService {
|
||||||
for (const element of baseStacks) {
|
for (const element of baseStacks) {
|
||||||
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
|
|
||||||
// if (verbose)
|
|
||||||
CloudRunnerLogger.log(
|
CloudRunnerLogger.log(
|
||||||
`Task Stack ${element.StackName} - Age D${Math.floor(
|
`Task Stack ${element.StackName} - Age D${Math.floor(
|
||||||
ageDate.getHours() / 24,
|
ageDate.getHours() / 24,
|
||||||
|
|
@ -101,7 +99,6 @@ export class TaskService {
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
const ageDate: Date = new Date(Date.now() - element.CreationTime.getTime());
|
||||||
|
|
||||||
// if (verbose)
|
|
||||||
CloudRunnerLogger.log(
|
CloudRunnerLogger.log(
|
||||||
`Task Stack ${element.StackName} - Age D${Math.floor(
|
`Task Stack ${element.StackName} - Age D${Math.floor(
|
||||||
ageDate.getHours() / 24,
|
ageDate.getHours() / 24,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ export class TertiaryResourcesService {
|
||||||
}
|
}
|
||||||
const ageDate: Date = new Date(Date.now() - element.creationTime);
|
const ageDate: Date = new Date(Date.now() - element.creationTime);
|
||||||
|
|
||||||
// if (verbose)
|
|
||||||
CloudRunnerLogger.log(
|
CloudRunnerLogger.log(
|
||||||
`Task Stack ${element.logGroupName} - Age D${Math.floor(
|
`Task Stack ${element.logGroupName} - Age D${Math.floor(
|
||||||
ageDate.getHours() / 24,
|
ageDate.getHours() / 24,
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,6 @@ import CloudRunnerQueryOverride from './cloud-runner-query-override';
|
||||||
import CloudRunnerOptionsReader from './cloud-runner-options-reader';
|
import CloudRunnerOptionsReader from './cloud-runner-options-reader';
|
||||||
import BuildParameters from '../../build-parameters';
|
import BuildParameters from '../../build-parameters';
|
||||||
import CloudRunnerOptions from '../cloud-runner-options';
|
import CloudRunnerOptions from '../cloud-runner-options';
|
||||||
|
|
||||||
// import CloudRunner from '../cloud-runner';
|
|
||||||
// import ImageEnvironmentFactory from '../../image-environment-factory';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
export class TaskParameterSerializer {
|
export class TaskParameterSerializer {
|
||||||
|
|
@ -47,16 +44,8 @@ export class TaskParameterSerializer {
|
||||||
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
x.name = TaskParameterSerializer.ToEnvVarFormat(x.name);
|
||||||
x.value = `${x.value}`;
|
x.value = `${x.value}`;
|
||||||
|
|
||||||
// if (x.name === `CUSTOM_JOB` || x.name === `GAMECI-CUSTOM_JOB`) {
|
if (buildParameters.cloudRunnerDebug && Number(x.name) === Number.NaN) {
|
||||||
// x.value = base64.encode(x.value);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (buildParameters.cloudRunnerDebug) {
|
|
||||||
if (Number(x.name) === Number.NaN) {
|
|
||||||
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
core.info(`[ERROR] found a number in task param serializer ${JSON.stringify(x)}`);
|
||||||
} else {
|
|
||||||
// core.info(`${JSON.stringify(x)}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
|
@ -64,9 +53,6 @@ export class TaskParameterSerializer {
|
||||||
(item) => item.name,
|
(item) => item.name,
|
||||||
);
|
);
|
||||||
|
|
||||||
// core.info(`Serialized Env Vars`);
|
|
||||||
// core.info(JSON.stringify(result, undefined, 4));
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,15 +79,9 @@ export class TaskParameterSerializer {
|
||||||
for (const element of keys) {
|
for (const element of keys) {
|
||||||
if (element !== `customJob`) {
|
if (element !== `customJob`) {
|
||||||
buildParameters[element] = process.env[`GAMECI_${TaskParameterSerializer.ToEnvVarFormat(element)}`];
|
buildParameters[element] = process.env[`GAMECI_${TaskParameterSerializer.ToEnvVarFormat(element)}`];
|
||||||
|
|
||||||
// buildParameters[element] = base64.decode(buildParameters[element]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (JSON.stringify(buildParameters) === JSON.stringify({})) {
|
|
||||||
// throw new Error(`Build parameters from environment are empty`);
|
|
||||||
// }
|
|
||||||
|
|
||||||
return buildParameters;
|
return buildParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,8 +121,6 @@ export class TaskParameterSerializer {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// core.info(JSON.stringify(array, undefined, 4));
|
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,18 +146,6 @@ export class TaskParameterSerializer {
|
||||||
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
||||||
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_LICENSE');
|
array = TaskParameterSerializer.tryAddInput(array, 'UNITY_LICENSE');
|
||||||
|
|
||||||
// array.push(
|
|
||||||
// ...ImageEnvironmentFactory.getEnvironmentVariables(CloudRunner.buildParameters)
|
|
||||||
// .filter((x) => array.every((y) => y.ParameterKey !== x.name))
|
|
||||||
// .map((x) => {
|
|
||||||
// return {
|
|
||||||
// ParameterKey: x.name,
|
|
||||||
// EnvironmentVariable: x.name,
|
|
||||||
// ParameterValue: x.value,
|
|
||||||
// };
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
private static getValue(key) {
|
private static getValue(key) {
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,6 @@ describe('Cloud Runner (Remote Client) Caching', () => {
|
||||||
);
|
);
|
||||||
await CloudRunnerSystem.Run(`du -h ${__dirname}`);
|
await CloudRunnerSystem.Run(`du -h ${__dirname}`);
|
||||||
|
|
||||||
// if (CloudRunnerOptions.cloudRunnerDebugTree) {
|
|
||||||
// await CloudRunnerSystem.Run(`tree ${testFolder}`);
|
|
||||||
// await CloudRunnerSystem.Run(`tree ${cacheFolder}`);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Compare validity to original hash
|
// Compare validity to original hash
|
||||||
expect(fs.readFileSync(path.resolve(testFolder, 'test.txt'), { encoding: 'utf8' }).toString()).toContain(
|
expect(fs.readFileSync(path.resolve(testFolder, 'test.txt'), { encoding: 'utf8' }).toString()).toContain(
|
||||||
Cli.options.cacheKey,
|
Cli.options.cacheKey,
|
||||||
|
|
|
||||||
|
|
@ -75,16 +75,10 @@ describe('Cloud Runner Sync Environments', () => {
|
||||||
.replace(/\s+/g, '')
|
.replace(/\s+/g, '')
|
||||||
.replace(new RegExp(`\\[${CloudRunnerStatics.logPrefix}\\]`, 'g'), '');
|
.replace(new RegExp(`\\[${CloudRunnerStatics.logPrefix}\\]`, 'g'), '');
|
||||||
for (const element of combined) {
|
for (const element of combined) {
|
||||||
// CloudRunnerLogger.log(`checking input/build param ${element.name} ${element.value}`);
|
|
||||||
expect(newLinePurgedFile).toContain(`${element.name}`);
|
expect(newLinePurgedFile).toContain(`${element.name}`);
|
||||||
CloudRunnerLogger.log(`Contains ${element.name}`);
|
CloudRunnerLogger.log(`Contains ${element.name}`);
|
||||||
const fullNameEqualValue = `${element.name}=${element.value}`;
|
const fullNameEqualValue = `${element.name}=${element.value}`;
|
||||||
expect(newLinePurgedFile).toContain(fullNameEqualValue);
|
expect(newLinePurgedFile).toContain(fullNameEqualValue);
|
||||||
|
|
||||||
// should not contain more than once
|
|
||||||
// expect(
|
|
||||||
// newLinePurgedFile.replace(fullNameEqualValue, '').replace(`GAMECI-${fullNameEqualValue}`, ''),
|
|
||||||
// ).not.toContain(fullNameEqualValue);
|
|
||||||
}
|
}
|
||||||
}, 10000000);
|
}, 10000000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue