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, asyncWorkflow: cloud_runner_options_1.default.asyncCloudRunner,
githubCheckId: cloud_runner_options_1.default.githubCheckId, githubCheckId: cloud_runner_options_1.default.githubCheckId,
triggerWorkflowOnComplete: cloud_runner_options_1.default.triggerWorkflowOnComplete, 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() { static get cloudRunnerDebugEnv() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) || false; return CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) || false;
} }
static get cloudRunnerDebugSkipLFS() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipLFS`) || false;
}
static get cloudRunnerDebugSkipCache() {
return CloudRunnerOptions.getInput(`cloudRunnerDebugSkipCache`) || false;
}
static get watchCloudRunnerToEnd() { static get watchCloudRunnerToEnd() {
if (CloudRunnerOptions.asyncCloudRunner) { if (CloudRunnerOptions.asyncCloudRunner) {
return false; return false;
@ -4374,6 +4382,9 @@ class Caching {
} }
static PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) { static PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (cloud_runner_1.default.buildParameters.cloudRunnerDebugSkipCache) {
return;
}
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');
let compressionSuffix = ''; let compressionSuffix = '';
if (cloud_runner_1.default.buildParameters.useLz4Compression === true) { if (cloud_runner_1.default.buildParameters.useLz4Compression === true) {
@ -4583,9 +4594,11 @@ class RemoteClient {
process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute); 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.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 config --global filter.lfs.process "git-lfs filter-process"`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`); if (!cloud_runner_1.default.buildParameters.cloudRunnerDebugSkipLFS) {
remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`);
console_1.assert(fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute)); 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() { 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 asyncWorkflow!: boolean;
public githubCheckId!: string; public githubCheckId!: string;
public triggerWorkflowOnComplete!: string[]; public triggerWorkflowOnComplete!: string[];
public cloudRunnerDebugSkipLFS!: boolean;
public cloudRunnerDebugSkipCache!: boolean;
static async create(): Promise<BuildParameters> { static async create(): Promise<BuildParameters> {
const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform, Input.androidAppBundle); const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform, Input.androidAppBundle);
@ -161,6 +163,8 @@ class BuildParameters {
asyncWorkflow: CloudRunnerOptions.asyncCloudRunner, asyncWorkflow: CloudRunnerOptions.asyncCloudRunner,
githubCheckId: CloudRunnerOptions.githubCheckId, githubCheckId: CloudRunnerOptions.githubCheckId,
triggerWorkflowOnComplete: CloudRunnerOptions.triggerWorkflowOnComplete, triggerWorkflowOnComplete: CloudRunnerOptions.triggerWorkflowOnComplete,
cloudRunnerDebugSkipLFS: CloudRunnerOptions.cloudRunnerDebugSkipLFS,
cloudRunnerDebugSkipCache: CloudRunnerOptions.cloudRunnerDebugSkipCache,
}; };
} }

View File

@ -240,6 +240,12 @@ class CloudRunnerOptions {
static get cloudRunnerDebugEnv(): boolean { static get cloudRunnerDebugEnv(): boolean {
return CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) || false; 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 { static get watchCloudRunnerToEnd(): boolean {
if (CloudRunnerOptions.asyncCloudRunner) { if (CloudRunnerOptions.asyncCloudRunner) {

View File

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

View File

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