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

This commit is contained in:
brian-golfplusvr 2025-02-07 10:41:55 -06:00
parent 4b9e1df58e
commit 05bb9931cc
6 changed files with 14 additions and 2 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'

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

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;