Get cloud runner secrets from
parent
e2e84372e3
commit
ea0af36589
|
|
@ -2939,21 +2939,24 @@ class TaskParameterSerializer {
|
|||
name: 'BUILD_TARGET',
|
||||
value: __1.CloudRunner.buildParameters.platform,
|
||||
},
|
||||
{
|
||||
name: 'UNITY_SERIAL',
|
||||
value: __1.Input.queryOverrides['UNITY_SERIAL'],
|
||||
},
|
||||
{
|
||||
name: 'UNITY_USERNAME',
|
||||
value: __1.Input.queryOverrides['UNITY_EMAIL'],
|
||||
},
|
||||
{
|
||||
name: 'UNITY_PASSWORD',
|
||||
value: __1.Input.queryOverrides['UNITY_PASSWORD'],
|
||||
},
|
||||
...TaskParameterSerializer.serializeBuildParamsAndInput,
|
||||
];
|
||||
}
|
||||
static getValue(key) {
|
||||
return __1.Input.queryOverrides !== null && __1.Input.queryOverrides[key] !== undefined
|
||||
? __1.Input.queryOverrides[key]
|
||||
: process.env[key];
|
||||
}
|
||||
static tryAddInput(array, key) {
|
||||
if (TaskParameterSerializer.getValue(key) !== undefined) {
|
||||
array.push({
|
||||
ParameterKey: key,
|
||||
EnvironmentVariable: key,
|
||||
ParameterValue: TaskParameterSerializer.getValue(key),
|
||||
});
|
||||
}
|
||||
return array();
|
||||
}
|
||||
static get serializeBuildParamsAndInput() {
|
||||
let array = new Array();
|
||||
array = TaskParameterSerializer.readBuildParameters(array);
|
||||
|
|
@ -2996,14 +2999,20 @@ class TaskParameterSerializer {
|
|||
return array;
|
||||
}
|
||||
static setupDefaultSecrets() {
|
||||
if (__1.CloudRunner.defaultSecrets === undefined)
|
||||
__1.CloudRunner.defaultSecrets = image_environment_factory_1.default.getEnvironmentVariables(__1.CloudRunner.buildParameters).map((x) => {
|
||||
if (__1.CloudRunner.defaultSecrets === undefined) {
|
||||
const array = new Array();
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_SERIAL');
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_EMAIL');
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
||||
array.push(...image_environment_factory_1.default.getEnvironmentVariables(__1.CloudRunner.buildParameters).map((x) => {
|
||||
return {
|
||||
ParameterKey: x.name,
|
||||
EnvironmentVariable: x.name,
|
||||
ParameterValue: x.value,
|
||||
};
|
||||
});
|
||||
}));
|
||||
__1.CloudRunner.defaultSecrets = array;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.TaskParameterSerializer = TaskParameterSerializer;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -19,21 +19,24 @@ export class TaskParameterSerializer {
|
|||
name: 'BUILD_TARGET',
|
||||
value: CloudRunner.buildParameters.platform,
|
||||
},
|
||||
{
|
||||
name: 'UNITY_SERIAL',
|
||||
value: Input.queryOverrides['UNITY_SERIAL'],
|
||||
},
|
||||
{
|
||||
name: 'UNITY_USERNAME',
|
||||
value: Input.queryOverrides['UNITY_EMAIL'],
|
||||
},
|
||||
{
|
||||
name: 'UNITY_PASSWORD',
|
||||
value: Input.queryOverrides['UNITY_PASSWORD'],
|
||||
},
|
||||
...TaskParameterSerializer.serializeBuildParamsAndInput,
|
||||
];
|
||||
}
|
||||
private static getValue(key) {
|
||||
return Input.queryOverrides !== null && Input.queryOverrides[key] !== undefined
|
||||
? Input.queryOverrides[key]
|
||||
: process.env[key];
|
||||
}
|
||||
private static tryAddInput(array, key) {
|
||||
if (TaskParameterSerializer.getValue(key) !== undefined) {
|
||||
array.push({
|
||||
ParameterKey: key,
|
||||
EnvironmentVariable: key,
|
||||
ParameterValue: TaskParameterSerializer.getValue(key),
|
||||
});
|
||||
}
|
||||
return array();
|
||||
}
|
||||
private static get serializeBuildParamsAndInput() {
|
||||
let array = new Array();
|
||||
array = TaskParameterSerializer.readBuildParameters(array);
|
||||
|
|
@ -82,15 +85,21 @@ export class TaskParameterSerializer {
|
|||
}
|
||||
|
||||
private static setupDefaultSecrets() {
|
||||
if (CloudRunner.defaultSecrets === undefined)
|
||||
CloudRunner.defaultSecrets = ImageEnvironmentFactory.getEnvironmentVariables(CloudRunner.buildParameters).map(
|
||||
(x) => {
|
||||
if (CloudRunner.defaultSecrets === undefined) {
|
||||
const array = new Array();
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_SERIAL');
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_EMAIL');
|
||||
TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');
|
||||
array.push(
|
||||
...ImageEnvironmentFactory.getEnvironmentVariables(CloudRunner.buildParameters).map((x) => {
|
||||
return {
|
||||
ParameterKey: x.name,
|
||||
EnvironmentVariable: x.name,
|
||||
ParameterValue: x.value,
|
||||
};
|
||||
},
|
||||
}),
|
||||
);
|
||||
CloudRunner.defaultSecrets = array;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue