better named tests and log local-docker params
parent
7c332a36fb
commit
f47566e286
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -34,7 +34,10 @@ export class CloudRunnerCustomHooks {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getSecrets(hooks) {
|
public static getSecrets(hooks) {
|
||||||
return hooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0);
|
const secrets = hooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0);
|
||||||
|
|
||||||
|
// eslint-disable-next-line unicorn/no-array-reduce
|
||||||
|
return secrets.length > 0 ? secrets.reduce((x, y) => [...x, ...y]) : [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class Hook {
|
export class Hook {
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ 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 * as core from '@actions/core';
|
|
||||||
|
|
||||||
// import CloudRunner from '../cloud-runner';
|
// import CloudRunner from '../cloud-runner';
|
||||||
// import ImageEnvironmentFactory from '../../image-environment-factory';
|
// import ImageEnvironmentFactory from '../../image-environment-factory';
|
||||||
|
|
||||||
export class TaskParameterSerializer {
|
export class TaskParameterSerializer {
|
||||||
|
static readonly blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
||||||
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
|
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
@ -26,36 +26,17 @@ export class TaskParameterSerializer {
|
||||||
name: 'BUILD_TARGET',
|
name: 'BUILD_TARGET',
|
||||||
value: buildParameters.targetPlatform,
|
value: buildParameters.targetPlatform,
|
||||||
},
|
},
|
||||||
...TaskParameterSerializer.serializeBuildParamsAndInput(buildParameters),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
private static serializeBuildParamsAndInput(buildParameters: BuildParameters) {
|
|
||||||
core.info(`Serializing ${JSON.stringify(buildParameters, undefined, 4)}`);
|
|
||||||
let array = [
|
|
||||||
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
||||||
...TaskParameterSerializer.readInput(),
|
...TaskParameterSerializer.readInput(),
|
||||||
];
|
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
||||||
core.info(`Array with object serialized build params and input ${JSON.stringify(array, undefined, 4)}`);
|
]
|
||||||
const secrets = CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks));
|
.filter((x) => !TaskParameterSerializer.blocked.has(x.name))
|
||||||
if (secrets.length > 0) {
|
.map((x) => {
|
||||||
// eslint-disable-next-line unicorn/no-array-reduce
|
x.name = Input.ToEnvVarFormat(x.name);
|
||||||
array.push(secrets.reduce((x, y) => [...x, ...y]));
|
x.value = `${x.value}`;
|
||||||
}
|
|
||||||
core.info(`Array with secrets added ${JSON.stringify(array, undefined, 4)}`);
|
|
||||||
|
|
||||||
const blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
return x;
|
||||||
|
});
|
||||||
array = array.filter((x) => !blocked.has(x.name));
|
|
||||||
core.info(`Array after blocking removed added ${JSON.stringify(array, undefined, 4)}`);
|
|
||||||
array = array.map((x) => {
|
|
||||||
x.name = Input.ToEnvVarFormat(x.name);
|
|
||||||
x.value = `${x.value}`;
|
|
||||||
|
|
||||||
return x;
|
|
||||||
});
|
|
||||||
core.info(`Array after env var formatting ${JSON.stringify(array, undefined, 4)}`);
|
|
||||||
|
|
||||||
return array;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readBuildParameterFromEnvironment(): BuildParameters {
|
public static readBuildParameterFromEnvironment(): BuildParameters {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue