Added cloneDepth for CloudRunner options to specify depth of clone on the repo

pull/686/head
brian-golfplusvr 2025-02-07 10:41:55 -06:00
parent 4b9e1df58e
commit 05bb9931cc
6 changed files with 20 additions and 4 deletions

View File

@ -261,7 +261,10 @@ inputs:
default: 'false' default: 'false'
required: false required: false
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.' description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
cloneDepth:
default: '50'
required: false
description: '[CloudRunner] Specifies the depth of the clone for the repository'
outputs: outputs:
volume: volume:
description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes' description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes'

6
dist/index.js generated vendored
View File

@ -363,6 +363,7 @@ class BuildParameters {
cacheUnityInstallationOnMac: input_1.default.cacheUnityInstallationOnMac, cacheUnityInstallationOnMac: input_1.default.cacheUnityInstallationOnMac,
unityHubVersionOnMac: input_1.default.unityHubVersionOnMac, unityHubVersionOnMac: input_1.default.unityHubVersionOnMac,
dockerWorkspacePath: input_1.default.dockerWorkspacePath, dockerWorkspacePath: input_1.default.dockerWorkspacePath,
cloneDepth: Number.parseInt(cloud_runner_options_1.default.cloneDepth),
}; };
} }
static parseBuildFile(filename, platform, androidExportType) { static parseBuildFile(filename, platform, androidExportType) {
@ -1222,6 +1223,9 @@ class CloudRunnerOptions {
static get customJob() { static get customJob() {
return CloudRunnerOptions.getInput('customJob') || ''; return CloudRunnerOptions.getInput('customJob') || '';
} }
static get cloneDepth() {
return CloudRunnerOptions.getInput('cloneDepth') || `50`;
}
// ### ### ### // ### ### ###
// Custom commands from files parameters // Custom commands from files parameters
// ### ### ### // ### ### ###
@ -4582,7 +4586,7 @@ class RemoteClient {
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"`); await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"`);
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`); await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`);
try { try {
await cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} ${node_path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}`); await cloud_runner_system_1.CloudRunnerSystem.Run(`git clone --depth ${cloud_runner_options_1.default.cloneDepth} ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} ${node_path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}`);
} }
catch (error) { catch (error) {
throw error; throw error;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -67,6 +67,7 @@ class BuildParameters {
public pullInputList!: string[]; public pullInputList!: string[];
public inputPullCommand!: string; public inputPullCommand!: string;
public cacheKey!: string; public cacheKey!: string;
public cloneDepth!: number;
public postBuildContainerHooks!: string; public postBuildContainerHooks!: string;
public preBuildContainerHooks!: string; public preBuildContainerHooks!: string;
@ -205,6 +206,7 @@ class BuildParameters {
pullInputList: CloudRunnerOptions.pullInputList, pullInputList: CloudRunnerOptions.pullInputList,
kubeStorageClass: CloudRunnerOptions.kubeStorageClass, kubeStorageClass: CloudRunnerOptions.kubeStorageClass,
cacheKey: CloudRunnerOptions.cacheKey, cacheKey: CloudRunnerOptions.cacheKey,
maxRetainedWorkspaces: Number.parseInt(CloudRunnerOptions.maxRetainedWorkspaces), maxRetainedWorkspaces: Number.parseInt(CloudRunnerOptions.maxRetainedWorkspaces),
useLargePackages: CloudRunnerOptions.useLargePackages, useLargePackages: CloudRunnerOptions.useLargePackages,
useCompressionStrategy: CloudRunnerOptions.useCompressionStrategy, useCompressionStrategy: CloudRunnerOptions.useCompressionStrategy,
@ -218,6 +220,7 @@ class BuildParameters {
cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac, cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac,
unityHubVersionOnMac: Input.unityHubVersionOnMac, unityHubVersionOnMac: Input.unityHubVersionOnMac,
dockerWorkspacePath: Input.dockerWorkspacePath, dockerWorkspacePath: Input.dockerWorkspacePath,
cloneDepth: Number.parseInt(CloudRunnerOptions.cloneDepth),
}; };
} }

View File

@ -139,6 +139,10 @@ class CloudRunnerOptions {
return CloudRunnerOptions.getInput('customJob') || ''; return CloudRunnerOptions.getInput('customJob') || '';
} }
static get cloneDepth(): string {
return CloudRunnerOptions.getInput('cloneDepth') || `50`;
}
// ### ### ### // ### ### ###
// Custom commands from files parameters // Custom commands from files parameters
// ### ### ### // ### ### ###

View File

@ -184,7 +184,9 @@ export class RemoteClient {
await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`); await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`);
try { try {
await CloudRunnerSystem.Run( await CloudRunnerSystem.Run(
`git clone ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`, `git clone --depth ${CloudRunnerOptions.cloneDepth} ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(
CloudRunnerFolders.repoPathAbsolute,
)}`,
); );
} catch (error: any) { } catch (error: any) {
throw error; throw error;