review comments
parent
108b5d3c87
commit
00317d7cda
|
@ -130,7 +130,7 @@ inputs:
|
|||
description:
|
||||
'[CloudRunner] Specify the names (by file name) of custom hooks to run before or after cloud runner jobs, must
|
||||
match a yaml step file inside your repo in the folder .game-ci/hooks/'
|
||||
customJobHooks:
|
||||
customCommandHooks:
|
||||
required: false
|
||||
default: ''
|
||||
description: '[CloudRunner] Specify custom commands and trigger hooks (injects commands into jobs)'
|
||||
|
|
|
@ -272,10 +272,9 @@ class BuildParameters {
|
|||
chownFilesTo: input_1.default.chownFilesTo,
|
||||
cloudRunnerCluster: cloud_runner_options_1.default.cloudRunnerCluster,
|
||||
cloudRunnerBuilderPlatform: cloud_runner_options_1.default.cloudRunnerBuilderPlatform,
|
||||
awsBaseStackName: cloud_runner_options_1.default.awsBaseStackName,
|
||||
kubeConfig: cloud_runner_options_1.default.kubeConfig,
|
||||
cloudRunnerMemory: cloud_runner_options_1.default.cloudRunnerMemory,
|
||||
cloudRunnerCpu: cloud_runner_options_1.default.cloudRunnerCpu,
|
||||
cloudRunnerMemory: cloud_runner_options_1.default.containerMemory,
|
||||
cloudRunnerCpu: cloud_runner_options_1.default.containerCpu,
|
||||
kubeVolumeSize: cloud_runner_options_1.default.kubeVolumeSize,
|
||||
kubeVolume: cloud_runner_options_1.default.kubeVolume,
|
||||
postBuildSteps: cloud_runner_options_1.default.postBuildSteps,
|
||||
|
@ -287,13 +286,13 @@ class BuildParameters {
|
|||
cloudRunnerDebug: cloud_runner_options_1.default.cloudRunnerDebug,
|
||||
githubRepo: input_1.default.githubRepo || (await git_repo_1.GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
||||
isCliMode: cli_1.Cli.isCliMode,
|
||||
awsStackName: cloud_runner_options_1.default.awsBaseStackName,
|
||||
awsStackName: cloud_runner_options_1.default.awsStackName,
|
||||
gitSha: input_1.default.gitSha,
|
||||
logId: nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)(),
|
||||
buildGuid: cloud_runner_guid_1.default.generateGuid(input_1.default.runNumber, input_1.default.targetPlatform),
|
||||
customJobHooks: cloud_runner_options_1.default.customJobHooks(),
|
||||
inputOverrideCommand: cloud_runner_options_1.default.inputOverrideCommand(),
|
||||
inputOverrides: cloud_runner_options_1.default.inputOverrides(),
|
||||
customCommandHooks: cloud_runner_options_1.default.customCommandHooks(),
|
||||
inputPullCommand: cloud_runner_options_1.default.inputPullCommand(),
|
||||
pullInputList: cloud_runner_options_1.default.pullInputList(),
|
||||
kubeStorageClass: cloud_runner_options_1.default.kubeStorageClass,
|
||||
cacheKey: cloud_runner_options_1.default.cacheKey,
|
||||
retainWorkspaces: cloud_runner_options_1.default.retainWorkspaces,
|
||||
|
@ -303,7 +302,7 @@ class BuildParameters {
|
|||
githubChecks: cloud_runner_options_1.default.githubChecks,
|
||||
asyncWorkflow: cloud_runner_options_1.default.asyncCloudRunner,
|
||||
githubCheckId: cloud_runner_options_1.default.githubCheckId,
|
||||
triggerWorkflowOnComplete: cloud_runner_options_1.default.triggerWorkflowOnComplete,
|
||||
triggerWorkflowOnComplete: cloud_runner_options_1.default.finalHooks,
|
||||
skipLFS: cloud_runner_options_1.default.skipLFS,
|
||||
skipCache: cloud_runner_options_1.default.skipCache,
|
||||
cacheUnityInstallationOnMac: input_1.default.cacheUnityInstallationOnMac,
|
||||
|
@ -746,13 +745,13 @@ class CloudRunnerOptions {
|
|||
return CloudRunnerOptions.getInput('githubCheckId') || ``;
|
||||
}
|
||||
static get githubOwner() {
|
||||
return CloudRunnerOptions.getInput('githubOwner') || CloudRunnerOptions.githubRepo.split(`/`)[0] || false;
|
||||
return CloudRunnerOptions.getInput('githubOwner') || CloudRunnerOptions.githubRepo?.split(`/`)[0] || '';
|
||||
}
|
||||
static get githubRepoName() {
|
||||
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo.split(`/`)[1] || false;
|
||||
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';
|
||||
}
|
||||
static get triggerWorkflowOnComplete() {
|
||||
return CloudRunnerOptions.getInput('triggerWorkflowOnComplete')?.split(',') || [];
|
||||
static get finalHooks() {
|
||||
return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];
|
||||
}
|
||||
// ### ### ###
|
||||
// Git syncronization parameters
|
||||
|
@ -801,11 +800,11 @@ class CloudRunnerOptions {
|
|||
}
|
||||
return CloudRunnerOptions.getInput('cloudRunnerCluster') || 'local';
|
||||
}
|
||||
static get cloudRunnerCpu() {
|
||||
return CloudRunnerOptions.getInput('cloudRunnerCpu');
|
||||
static get containerCpu() {
|
||||
return CloudRunnerOptions.getInput('containerCpu');
|
||||
}
|
||||
static get cloudRunnerMemory() {
|
||||
return CloudRunnerOptions.getInput('cloudRunnerMemory');
|
||||
static get containerMemory() {
|
||||
return CloudRunnerOptions.getInput('containerMemory');
|
||||
}
|
||||
static get customJob() {
|
||||
return CloudRunnerOptions.getInput('customJob') || '';
|
||||
|
@ -822,8 +821,8 @@ class CloudRunnerOptions {
|
|||
// ### ### ###
|
||||
// Custom commands from yaml parameters
|
||||
// ### ### ###
|
||||
static customJobHooks() {
|
||||
return CloudRunnerOptions.getInput('customJobHooks') || '';
|
||||
static customCommandHooks() {
|
||||
return CloudRunnerOptions.getInput('customCommandHooks') || '';
|
||||
}
|
||||
static get postBuildSteps() {
|
||||
return CloudRunnerOptions.getInput('postBuildSteps') || '';
|
||||
|
@ -834,11 +833,11 @@ class CloudRunnerOptions {
|
|||
// ### ### ###
|
||||
// Input override handling
|
||||
// ### ### ###
|
||||
static inputOverrides() {
|
||||
return CloudRunnerOptions.getInput('inputOverrides') || '';
|
||||
static pullInputList() {
|
||||
return CloudRunnerOptions.getInput('pullInputList')?.split(`,`) || [];
|
||||
}
|
||||
static inputOverrideCommand() {
|
||||
const value = CloudRunnerOptions.getInput('inputOverrideCommand');
|
||||
static inputPullCommand() {
|
||||
const value = CloudRunnerOptions.getInput('inputPullCommand');
|
||||
if (value === 'gcp-secret-manager') {
|
||||
return 'gcloud secrets versions access 1 --secret="{0}"';
|
||||
}
|
||||
|
@ -850,7 +849,7 @@ class CloudRunnerOptions {
|
|||
// ### ### ###
|
||||
// Aws
|
||||
// ### ### ###
|
||||
static get awsBaseStackName() {
|
||||
static get awsStackName() {
|
||||
return CloudRunnerOptions.getInput('awsBaseStackName') || 'game-ci';
|
||||
}
|
||||
// ### ### ###
|
||||
|
@ -2906,10 +2905,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
|
||||
const docker_1 = __importDefault(__nccwpck_require__(16934));
|
||||
const __1 = __nccwpck_require__(41359);
|
||||
const fs_1 = __nccwpck_require__(57147);
|
||||
const node_fs_1 = __nccwpck_require__(87561);
|
||||
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
|
||||
const cloud_runner_system_1 = __nccwpck_require__(99393);
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const fs = __importStar(__nccwpck_require__(87561));
|
||||
const cloud_runner_custom_hooks_1 = __nccwpck_require__(58873);
|
||||
class LocalDockerCloudRunner {
|
||||
listResources() {
|
||||
|
@ -2987,7 +2986,7 @@ cp -a /github/workspace/cloud-runner-cache/. ${sharedFolder}
|
|||
${cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.ApplyHooksToCommands(commands, this.buildParameters)}
|
||||
cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
|
||||
`;
|
||||
fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, fileContents, {
|
||||
node_fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, fileContents, {
|
||||
flag: 'w',
|
||||
});
|
||||
if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {
|
||||
|
@ -4409,12 +4408,12 @@ const yaml_1 = __importDefault(__nccwpck_require__(44603));
|
|||
const remote_client_logger_1 = __nccwpck_require__(59412);
|
||||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const fs = __importStar(__nccwpck_require__(87561));
|
||||
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
|
||||
// import CloudRunnerLogger from './cloud-runner-logger';
|
||||
class CloudRunnerCustomHooks {
|
||||
static ApplyHooksToCommands(commands, buildParameters) {
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks);
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customCommandHooks);
|
||||
cloud_runner_logger_1.default.log(`Applying hooks ${hooks.length}`);
|
||||
return `echo "---"
|
||||
echo "start cloud runner init"
|
||||
|
@ -4426,8 +4425,8 @@ ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
|||
echo "end of cloud runner job"
|
||||
echo "---${buildParameters.logId}"`;
|
||||
}
|
||||
static getHooks(customJobHooks) {
|
||||
const experimentHooks = customJobHooks;
|
||||
static getHooks(customCommandHooks) {
|
||||
const experimentHooks = customCommandHooks;
|
||||
let output = new Array();
|
||||
if (experimentHooks && experimentHooks !== '') {
|
||||
try {
|
||||
|
@ -5013,10 +5012,10 @@ class CloudRunnerQueryOverride {
|
|||
return;
|
||||
}
|
||||
static shouldUseOverride(query) {
|
||||
if (cloud_runner_options_1.default.inputOverrideCommand() !== '') {
|
||||
if (cloud_runner_options_1.default.inputOverrides() !== '') {
|
||||
const doesInclude = cloud_runner_options_1.default.inputOverrides().split(',').includes(query) ||
|
||||
cloud_runner_options_1.default.inputOverrides().split(',').includes(input_1.default.ToEnvVarFormat(query));
|
||||
if (cloud_runner_options_1.default.inputPullCommand() !== '') {
|
||||
if (cloud_runner_options_1.default.pullInputList().length > 0) {
|
||||
const doesInclude = cloud_runner_options_1.default.pullInputList().includes(query) ||
|
||||
cloud_runner_options_1.default.pullInputList().includes(input_1.default.ToEnvVarFormat(query));
|
||||
return doesInclude ? true : false;
|
||||
}
|
||||
else {
|
||||
|
@ -5028,10 +5027,10 @@ class CloudRunnerQueryOverride {
|
|||
if (!this.shouldUseOverride(query)) {
|
||||
throw new Error(`Should not be trying to run override query on ${query}`);
|
||||
}
|
||||
return await generic_input_reader_1.GenericInputReader.Run(formatFunction(cloud_runner_options_1.default.inputOverrideCommand(), [{ key: 0, value: query }]));
|
||||
return await generic_input_reader_1.GenericInputReader.Run(formatFunction(cloud_runner_options_1.default.inputPullCommand(), [{ key: 0, value: query }]));
|
||||
}
|
||||
static async PopulateQueryOverrideInput() {
|
||||
const queries = cloud_runner_options_1.default.inputOverrides().split(',');
|
||||
const queries = cloud_runner_options_1.default.pullInputList();
|
||||
CloudRunnerQueryOverride.queryOverrides = {};
|
||||
for (const element of queries) {
|
||||
if (CloudRunnerQueryOverride.shouldUseOverride(element)) {
|
||||
|
@ -5225,7 +5224,7 @@ exports.LfsHashing = void 0;
|
|||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||
const cloud_runner_folders_1 = __nccwpck_require__(13527);
|
||||
const cloud_runner_system_1 = __nccwpck_require__(99393);
|
||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||
const node_fs_1 = __importDefault(__nccwpck_require__(87561));
|
||||
const cli_1 = __nccwpck_require__(55651);
|
||||
const cli_functions_repository_1 = __nccwpck_require__(85301);
|
||||
class LfsHashing {
|
||||
|
@ -5233,10 +5232,10 @@ class LfsHashing {
|
|||
await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`);
|
||||
const lfsHashes = {
|
||||
lfsGuid: fs_1.default
|
||||
lfsGuid: node_fs_1.default
|
||||
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8')
|
||||
.replace(/\n/g, ``),
|
||||
lfsGuidSum: fs_1.default
|
||||
lfsGuidSum: node_fs_1.default
|
||||
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8')
|
||||
.replace(' .lfs-assets-guid', '')
|
||||
.replace(/\n/g, ``),
|
||||
|
@ -5507,7 +5506,7 @@ class TaskParameterSerializer {
|
|||
],
|
||||
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
||||
...TaskParameterSerializer.readInput(),
|
||||
...cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getSecrets(cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
||||
...cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getSecrets(cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(buildParameters.customCommandHooks)),
|
||||
]
|
||||
.filter((x) => !TaskParameterSerializer.blocked.has(x.name) &&
|
||||
x.value !== '' &&
|
||||
|
@ -5757,8 +5756,8 @@ class BuildAutomationWorkflow {
|
|||
return output;
|
||||
}
|
||||
static get BuildWorkflow() {
|
||||
const setupHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step?.includes(`setup`));
|
||||
const buildHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step?.includes(`build`));
|
||||
const setupHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customCommandHooks).filter((x) => x.step?.includes(`setup`));
|
||||
const buildHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customCommandHooks).filter((x) => x.step?.includes(`build`));
|
||||
const builderPath = cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`));
|
||||
return `apt-get update > /dev/null
|
||||
apt-get install -y curl tar tree npm git-lfs jq git > /dev/null
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42,7 +42,6 @@ class BuildParameters {
|
|||
public customParameters!: string;
|
||||
public sshAgent!: string;
|
||||
public cloudRunnerCluster!: string;
|
||||
public awsBaseStackName!: string;
|
||||
public gitPrivateToken!: string;
|
||||
public awsStackName!: string;
|
||||
public kubeConfig!: string;
|
||||
|
@ -52,9 +51,9 @@ class BuildParameters {
|
|||
public kubeVolume!: string;
|
||||
public kubeStorageClass!: string;
|
||||
public chownFilesTo!: string;
|
||||
public customJobHooks!: string;
|
||||
public inputOverrides!: string;
|
||||
public inputOverrideCommand!: string;
|
||||
public customCommandHooks!: string;
|
||||
public pullInputList!: string[];
|
||||
public inputPullCommand!: string;
|
||||
public cacheKey!: string;
|
||||
|
||||
public postBuildSteps!: string;
|
||||
|
@ -152,10 +151,9 @@ class BuildParameters {
|
|||
chownFilesTo: Input.chownFilesTo,
|
||||
cloudRunnerCluster: CloudRunnerOptions.cloudRunnerCluster,
|
||||
cloudRunnerBuilderPlatform: CloudRunnerOptions.cloudRunnerBuilderPlatform,
|
||||
awsBaseStackName: CloudRunnerOptions.awsBaseStackName,
|
||||
kubeConfig: CloudRunnerOptions.kubeConfig,
|
||||
cloudRunnerMemory: CloudRunnerOptions.cloudRunnerMemory,
|
||||
cloudRunnerCpu: CloudRunnerOptions.cloudRunnerCpu,
|
||||
cloudRunnerMemory: CloudRunnerOptions.containerMemory,
|
||||
cloudRunnerCpu: CloudRunnerOptions.containerCpu,
|
||||
kubeVolumeSize: CloudRunnerOptions.kubeVolumeSize,
|
||||
kubeVolume: CloudRunnerOptions.kubeVolume,
|
||||
postBuildSteps: CloudRunnerOptions.postBuildSteps,
|
||||
|
@ -167,13 +165,13 @@ class BuildParameters {
|
|||
cloudRunnerDebug: CloudRunnerOptions.cloudRunnerDebug,
|
||||
githubRepo: Input.githubRepo || (await GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
||||
isCliMode: Cli.isCliMode,
|
||||
awsStackName: CloudRunnerOptions.awsBaseStackName,
|
||||
awsStackName: CloudRunnerOptions.awsStackName,
|
||||
gitSha: Input.gitSha,
|
||||
logId: customAlphabet(CloudRunnerConstants.alphabet, 9)(),
|
||||
buildGuid: CloudRunnerBuildGuid.generateGuid(Input.runNumber, Input.targetPlatform),
|
||||
customJobHooks: CloudRunnerOptions.customJobHooks(),
|
||||
inputOverrideCommand: CloudRunnerOptions.inputOverrideCommand(),
|
||||
inputOverrides: CloudRunnerOptions.inputOverrides(),
|
||||
customCommandHooks: CloudRunnerOptions.customCommandHooks(),
|
||||
inputPullCommand: CloudRunnerOptions.inputPullCommand(),
|
||||
pullInputList: CloudRunnerOptions.pullInputList(),
|
||||
kubeStorageClass: CloudRunnerOptions.kubeStorageClass,
|
||||
cacheKey: CloudRunnerOptions.cacheKey,
|
||||
retainWorkspaces: CloudRunnerOptions.retainWorkspaces,
|
||||
|
@ -183,7 +181,7 @@ class BuildParameters {
|
|||
githubChecks: CloudRunnerOptions.githubChecks,
|
||||
asyncWorkflow: CloudRunnerOptions.asyncCloudRunner,
|
||||
githubCheckId: CloudRunnerOptions.githubCheckId,
|
||||
triggerWorkflowOnComplete: CloudRunnerOptions.triggerWorkflowOnComplete,
|
||||
triggerWorkflowOnComplete: CloudRunnerOptions.finalHooks,
|
||||
skipLFS: CloudRunnerOptions.skipLFS,
|
||||
skipCache: CloudRunnerOptions.skipCache,
|
||||
cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac,
|
||||
|
|
|
@ -70,16 +70,16 @@ class CloudRunnerOptions {
|
|||
return CloudRunnerOptions.getInput('githubCheckId') || ``;
|
||||
}
|
||||
|
||||
static get githubOwner() {
|
||||
return CloudRunnerOptions.getInput('githubOwner') || CloudRunnerOptions.githubRepo.split(`/`)[0] || false;
|
||||
static get githubOwner(): string {
|
||||
return CloudRunnerOptions.getInput('githubOwner') || CloudRunnerOptions.githubRepo?.split(`/`)[0] || '';
|
||||
}
|
||||
|
||||
static get githubRepoName() {
|
||||
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo.split(`/`)[1] || false;
|
||||
static get githubRepoName(): string {
|
||||
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';
|
||||
}
|
||||
|
||||
static get triggerWorkflowOnComplete(): string[] {
|
||||
return CloudRunnerOptions.getInput('triggerWorkflowOnComplete')?.split(',') || [];
|
||||
static get finalHooks(): string[] {
|
||||
return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];
|
||||
}
|
||||
|
||||
// ### ### ###
|
||||
|
@ -135,12 +135,12 @@ class CloudRunnerOptions {
|
|||
return CloudRunnerOptions.getInput('cloudRunnerCluster') || 'local';
|
||||
}
|
||||
|
||||
static get cloudRunnerCpu() {
|
||||
return CloudRunnerOptions.getInput('cloudRunnerCpu');
|
||||
static get containerCpu() {
|
||||
return CloudRunnerOptions.getInput('containerCpu');
|
||||
}
|
||||
|
||||
static get cloudRunnerMemory() {
|
||||
return CloudRunnerOptions.getInput('cloudRunnerMemory');
|
||||
static get containerMemory() {
|
||||
return CloudRunnerOptions.getInput('containerMemory');
|
||||
}
|
||||
|
||||
static get customJob() {
|
||||
|
@ -163,8 +163,8 @@ class CloudRunnerOptions {
|
|||
// Custom commands from yaml parameters
|
||||
// ### ### ###
|
||||
|
||||
static customJobHooks() {
|
||||
return CloudRunnerOptions.getInput('customJobHooks') || '';
|
||||
static customCommandHooks() {
|
||||
return CloudRunnerOptions.getInput('customCommandHooks') || '';
|
||||
}
|
||||
|
||||
static get postBuildSteps() {
|
||||
|
@ -179,12 +179,12 @@ class CloudRunnerOptions {
|
|||
// Input override handling
|
||||
// ### ### ###
|
||||
|
||||
static inputOverrides() {
|
||||
return CloudRunnerOptions.getInput('inputOverrides') || '';
|
||||
static pullInputList(): string[] {
|
||||
return CloudRunnerOptions.getInput('pullInputList')?.split(`,`) || [];
|
||||
}
|
||||
|
||||
static inputOverrideCommand() {
|
||||
const value = CloudRunnerOptions.getInput('inputOverrideCommand');
|
||||
static inputPullCommand(): string {
|
||||
const value = CloudRunnerOptions.getInput('inputPullCommand');
|
||||
|
||||
if (value === 'gcp-secret-manager') {
|
||||
return 'gcloud secrets versions access 1 --secret="{0}"';
|
||||
|
@ -199,7 +199,7 @@ class CloudRunnerOptions {
|
|||
// Aws
|
||||
// ### ### ###
|
||||
|
||||
static get awsBaseStackName() {
|
||||
static get awsStackName() {
|
||||
return CloudRunnerOptions.getInput('awsBaseStackName') || 'game-ci';
|
||||
}
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ import { ProviderInterface } from '../provider-interface';
|
|||
import CloudRunnerSecret from '../../services/cloud-runner-secret';
|
||||
import Docker from '../../../docker';
|
||||
import { Action } from '../../..';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import CloudRunner from '../../cloud-runner';
|
||||
import { ProviderResource } from '../provider-resource';
|
||||
import { ProviderWorkflow } from '../provider-workflow';
|
||||
import { CloudRunnerSystem } from '../../services/cloud-runner-system';
|
||||
import * as fs from 'fs';
|
||||
import * as fs from 'node:fs';
|
||||
import { CloudRunnerCustomHooks } from '../../services/cloud-runner-custom-hooks';
|
||||
|
||||
class LocalDockerCloudRunner implements ProviderInterface {
|
||||
|
|
|
@ -4,14 +4,14 @@ import CloudRunnerSecret from './cloud-runner-secret';
|
|||
import { RemoteClientLogger } from '../remote-client/remote-client-logger';
|
||||
import path from 'path';
|
||||
import CloudRunnerOptions from '../cloud-runner-options';
|
||||
import * as fs from 'fs';
|
||||
import * as fs from 'node:fs';
|
||||
import CloudRunnerLogger from './cloud-runner-logger';
|
||||
|
||||
// import CloudRunnerLogger from './cloud-runner-logger';
|
||||
|
||||
export class CloudRunnerCustomHooks {
|
||||
public static ApplyHooksToCommands(commands: string, buildParameters: BuildParameters): string {
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks);
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customCommandHooks);
|
||||
CloudRunnerLogger.log(`Applying hooks ${hooks.length}`);
|
||||
|
||||
return `echo "---"
|
||||
|
@ -25,8 +25,8 @@ echo "end of cloud runner job"
|
|||
echo "---${buildParameters.logId}"`;
|
||||
}
|
||||
|
||||
public static getHooks(customJobHooks: any): Hook[] {
|
||||
const experimentHooks = customJobHooks;
|
||||
public static getHooks(customCommandHooks: any): Hook[] {
|
||||
const experimentHooks = customCommandHooks;
|
||||
let output = new Array<Hook>();
|
||||
if (experimentHooks && experimentHooks !== '') {
|
||||
try {
|
||||
|
|
|
@ -31,11 +31,11 @@ class CloudRunnerQueryOverride {
|
|||
}
|
||||
|
||||
private static shouldUseOverride(query: string) {
|
||||
if (CloudRunnerOptions.inputOverrideCommand() !== '') {
|
||||
if (CloudRunnerOptions.inputOverrides() !== '') {
|
||||
if (CloudRunnerOptions.inputPullCommand() !== '') {
|
||||
if (CloudRunnerOptions.pullInputList().length > 0) {
|
||||
const doesInclude =
|
||||
CloudRunnerOptions.inputOverrides().split(',').includes(query) ||
|
||||
CloudRunnerOptions.inputOverrides().split(',').includes(Input.ToEnvVarFormat(query));
|
||||
CloudRunnerOptions.pullInputList().includes(query) ||
|
||||
CloudRunnerOptions.pullInputList().includes(Input.ToEnvVarFormat(query));
|
||||
|
||||
return doesInclude ? true : false;
|
||||
} else {
|
||||
|
@ -50,12 +50,12 @@ class CloudRunnerQueryOverride {
|
|||
}
|
||||
|
||||
return await GenericInputReader.Run(
|
||||
formatFunction(CloudRunnerOptions.inputOverrideCommand(), [{ key: 0, value: query }]),
|
||||
formatFunction(CloudRunnerOptions.inputPullCommand(), [{ key: 0, value: query }]),
|
||||
);
|
||||
}
|
||||
|
||||
public static async PopulateQueryOverrideInput() {
|
||||
const queries = CloudRunnerOptions.inputOverrides().split(',');
|
||||
const queries = CloudRunnerOptions.pullInputList();
|
||||
CloudRunnerQueryOverride.queryOverrides = {};
|
||||
for (const element of queries) {
|
||||
if (CloudRunnerQueryOverride.shouldUseOverride(element)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import path from 'path';
|
||||
import { CloudRunnerFolders } from './cloud-runner-folders';
|
||||
import { CloudRunnerSystem } from './cloud-runner-system';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
import { Cli } from '../../cli/cli';
|
||||
import { CliFunction } from '../../cli/cli-functions-repository';
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ export class TaskParameterSerializer {
|
|||
],
|
||||
...TaskParameterSerializer.serializeFromObject(buildParameters),
|
||||
...TaskParameterSerializer.readInput(),
|
||||
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks)),
|
||||
...CloudRunnerCustomHooks.getSecrets(CloudRunnerCustomHooks.getHooks(buildParameters.customCommandHooks)),
|
||||
]
|
||||
.filter(
|
||||
(x) =>
|
||||
|
|
|
@ -3,7 +3,7 @@ import CloudRunner from '../cloud-runner';
|
|||
import UnityVersioning from '../../unity-versioning';
|
||||
import CloudRunnerOptions from '../cloud-runner-options';
|
||||
import setups from './cloud-runner-suite.test';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
import { CreateParameters } from './create-test-parameter';
|
||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import CloudRunnerOptions from '../../cloud-runner-options';
|
||||
import setups from '../cloud-runner-suite.test';
|
||||
import * as fs from 'fs';
|
||||
import * as fs from 'node:fs';
|
||||
import { CloudRunnerSystem } from '../../services/cloud-runner-system';
|
||||
|
||||
async function CreateParameters(overrides: any) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import CloudRunnerOptions from '../../cloud-runner-options';
|
||||
import setups from './../cloud-runner-suite.test';
|
||||
import * as fs from 'fs';
|
||||
import * as fs from 'node:fs';
|
||||
import path from 'path';
|
||||
import { CloudRunnerFolders } from '../../services/cloud-runner-folders';
|
||||
import SharedWorkspaceLocking from '../../services/shared-workspace-locking';
|
||||
|
|
|
@ -49,10 +49,10 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
|||
}
|
||||
|
||||
private static get BuildWorkflow() {
|
||||
const setupHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
||||
const setupHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customCommandHooks).filter((x) =>
|
||||
x.step?.includes(`setup`),
|
||||
);
|
||||
const buildHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
||||
const buildHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customCommandHooks).filter((x) =>
|
||||
x.step?.includes(`build`),
|
||||
);
|
||||
const builderPath = CloudRunnerFolders.ToLinuxFolder(
|
||||
|
|
Loading…
Reference in New Issue