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) {
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import CloudRunnerQueryOverride from './cloud-runner-query-override';
|
|||
import CloudRunnerOptionsReader from './cloud-runner-options-reader';
|
||||
import BuildParameters from '../../build-parameters';
|
||||
import CloudRunnerOptions from '../cloud-runner-options';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
// import CloudRunner from '../cloud-runner';
|
||||
// import ImageEnvironmentFactory from '../../image-environment-factory';
|
||||
|
||||
export class TaskParameterSerializer {
|
||||
static readonly blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
||||
public static readBuildEnvironmentVariables(buildParameters: BuildParameters): CloudRunnerEnvironmentVariable[] {
|
||||
return [
|
||||
{
|
||||
|
|
@ -26,36 +26,17 @@ export class TaskParameterSerializer {
|
|||
name: 'BUILD_TARGET',
|
||||
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.readInput(),
|
||||
];
|
||||
core.info(`Array with object serialized build params and input ${JSON.stringify(array, undefined, 4)}`);
|
||||
const secrets = CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks));
|
||||
if (secrets.length > 0) {
|
||||
// eslint-disable-next-line unicorn/no-array-reduce
|
||||
array.push(secrets.reduce((x, y) => [...x, ...y]));
|
||||
}
|
||||
core.info(`Array with secrets added ${JSON.stringify(array, undefined, 4)}`);
|
||||
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
||||
]
|
||||
.filter((x) => !TaskParameterSerializer.blocked.has(x.name))
|
||||
.map((x) => {
|
||||
x.name = Input.ToEnvVarFormat(x.name);
|
||||
x.value = `${x.value}`;
|
||||
|
||||
const blocked = new Set(['0', 'length', 'prototype', '', 'unityVersion']);
|
||||
|
||||
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;
|
||||
return x;
|
||||
});
|
||||
}
|
||||
|
||||
public static readBuildParameterFromEnvironment(): BuildParameters {
|
||||
|
|
|
|||
Loading…
Reference in New Issue