debug skip cache and lfs capability

pull/496/head
Frostebite 2023-02-08 18:12:35 +00:00
parent 5a08d19fa4
commit b324d78732
6 changed files with 35 additions and 7 deletions

19
dist/index.js generated vendored
View File

@ -310,6 +310,8 @@ class BuildParameters {
asyncWorkflow: cloud_runner_options_1.default.asyncCloudRunner,
githubCheckId: cloud_runner_options_1.default.githubCheckId,
triggerWorkflowOnComplete: cloud_runner_options_1.default.triggerWorkflowOnComplete,
cloudRunnerDebugSkipLFS: cloud_runner_options_1.default.cloudRunnerDebugSkipLFS,
cloudRunnerDebugSkipCache: cloud_runner_options_1.default.cloudRunnerDebugSkipCache,
};
});
}
@ -891,6 +893,12 @@ class CloudRunnerOptions {
static get cloudRunnerDebugEnv() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) || false;
}
static get cloudRunnerDebugSkipLFS() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipLFS`) || false;
}
static get cloudRunnerDebugSkipCache() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipCache`) || false;
}
static get watchCloudRunnerToEnd() {
if (CloudRunnerOptions.asyncCloudRunner) {
return false;
@ -4374,6 +4382,9 @@ class Caching {
}
static PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) {
return __awaiter(this, void 0, void 0, function* () {
if (cloud_runner_1.default.buildParameters.cloudRunnerDebugSkipCache) {
return;
}
cacheArtifactName = cacheArtifactName.replace(' ', '');
let compressionSuffix = '';
if (cloud_runner_1.default.buildParameters.useLz4Compression === true) {
@ -4583,9 +4594,11 @@ class RemoteClient {
process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge -- %f"`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process"`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`);
remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`);
console_1.assert(fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute));
if (!cloud_runner_1.default.buildParameters.cloudRunnerDebugSkipLFS) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`);
remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`);
console_1.assert(fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute));
}
});
}
static runRemoteClientJob() {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -74,6 +74,8 @@ class BuildParameters {
public asyncWorkflow!: boolean;
public githubCheckId!: string;
public triggerWorkflowOnComplete!: string[];
public cloudRunnerDebugSkipLFS!: boolean;
public cloudRunnerDebugSkipCache!: boolean;
static async create(): Promise<BuildParameters> {
const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform, Input.androidAppBundle);
@ -161,6 +163,8 @@ class BuildParameters {
asyncWorkflow: CloudRunnerOptions.asyncCloudRunner,
githubCheckId: CloudRunnerOptions.githubCheckId,
triggerWorkflowOnComplete: CloudRunnerOptions.triggerWorkflowOnComplete,
cloudRunnerDebugSkipLFS: CloudRunnerOptions.cloudRunnerDebugSkipLFS,
cloudRunnerDebugSkipCache: CloudRunnerOptions.cloudRunnerDebugSkipCache,
};
}

View File

@ -240,6 +240,12 @@ class CloudRunnerOptions {
static get cloudRunnerDebugEnv(): boolean {
return CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) || false;
}
static get cloudRunnerDebugSkipLFS(): boolean {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipLFS`) || false;
}
static get cloudRunnerDebugSkipCache(): boolean {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipCache`) || false;
}
static get watchCloudRunnerToEnd(): boolean {
if (CloudRunnerOptions.asyncCloudRunner) {

View File

@ -102,6 +102,9 @@ export class Caching {
process.chdir(`${startPath}`);
}
public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) {
if (CloudRunner.buildParameters.cloudRunnerDebugSkipCache) {
return;
}
cacheArtifactName = cacheArtifactName.replace(' ', '');
let compressionSuffix = '';
if (CloudRunner.buildParameters.useLz4Compression === true) {

View File

@ -128,9 +128,11 @@ export class RemoteClient {
process.chdir(CloudRunnerFolders.repoPathAbsolute);
await CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge -- %f"`);
await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process"`);
await CloudRunnerSystem.Run(`git lfs pull`);
RemoteClientLogger.log(`pulled latest LFS files`);
assert(fs.existsSync(CloudRunnerFolders.lfsFolderAbsolute));
if (!CloudRunner.buildParameters.cloudRunnerDebugSkipLFS) {
await CloudRunnerSystem.Run(`git lfs pull`);
RemoteClientLogger.log(`pulled latest LFS files`);
assert(fs.existsSync(CloudRunnerFolders.lfsFolderAbsolute));
}
}
@CliFunction(`remote-cli-pre-build`, `sets up a repository, usually before a game-ci build`)