From a982f45ecc32353d6a392bfd6de08ab25f6c9ee5 Mon Sep 17 00:00:00 2001 From: Frostebite Date: Sun, 12 Feb 2023 21:18:17 +0000 Subject: [PATCH] pipeline improvements --- .../cloud-runner/remote-client/caching.ts | 2 -- src/model/cloud-runner/remote-client/index.ts | 1 + .../cloud-runner/services/lfs-hashing.ts | 32 ++++++++----------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/model/cloud-runner/remote-client/caching.ts b/src/model/cloud-runner/remote-client/caching.ts index 8cd6080e..b45a06c8 100644 --- a/src/model/cloud-runner/remote-client/caching.ts +++ b/src/model/cloud-runner/remote-client/caching.ts @@ -105,8 +105,6 @@ export class Caching { public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) { CloudRunnerLogger.log(`Pulling from cache ${destinationFolder}`); if (CloudRunner.buildParameters.cloudRunnerDebugSkipCache) { - await new Promise((resolve) => resolve); - return; } cacheArtifactName = cacheArtifactName.replace(' ', ''); diff --git a/src/model/cloud-runner/remote-client/index.ts b/src/model/cloud-runner/remote-client/index.ts index 09faf048..04646848 100644 --- a/src/model/cloud-runner/remote-client/index.ts +++ b/src/model/cloud-runner/remote-client/index.ts @@ -27,6 +27,7 @@ export class RemoteClient { CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute), ); const lfsHashes = await LfsHashing.createLFSHashFiles(); + CloudRunnerLogger.log(`lfs hash completion: ${lfsHashes.lfsGuid} ${lfsHashes.lfsGuidSum}`); if (fs.existsSync(CloudRunnerFolders.libraryFolderAbsolute)) { RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`); } diff --git a/src/model/cloud-runner/services/lfs-hashing.ts b/src/model/cloud-runner/services/lfs-hashing.ts index 9d43130a..e5befea0 100644 --- a/src/model/cloud-runner/services/lfs-hashing.ts +++ b/src/model/cloud-runner/services/lfs-hashing.ts @@ -8,25 +8,21 @@ import { CliFunction } from '../../cli/cli-functions-repository'; export class LfsHashing { public static async createLFSHashFiles() { - try { - await CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`); - await CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`); - assert(fs.existsSync(`.lfs-assets-guid-sum`)); - assert(fs.existsSync(`.lfs-assets-guid`)); - const lfsHashes = { - lfsGuid: fs - .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8') - .replace(/\n/g, ``), - lfsGuidSum: fs - .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8') - .replace(' .lfs-assets-guid', '') - .replace(/\n/g, ``), - }; + await CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`); + await CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`); + assert(fs.existsSync(`.lfs-assets-guid-sum`)); + assert(fs.existsSync(`.lfs-assets-guid`)); + const lfsHashes = { + lfsGuid: fs + .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8') + .replace(/\n/g, ``), + lfsGuidSum: fs + .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8') + .replace(' .lfs-assets-guid', '') + .replace(/\n/g, ``), + }; - return lfsHashes; - } catch (error) { - throw error; - } + return lfsHashes; } public static async hashAllFiles(folder: string) { const startPath = process.cwd();