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