pipeline improvements

pull/496/head
Frostebite 2023-02-12 21:18:17 +00:00
parent f093981f42
commit a982f45ecc
3 changed files with 15 additions and 20 deletions

View File

@ -105,8 +105,6 @@ export class Caching {
public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) { public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) {
CloudRunnerLogger.log(`Pulling from cache ${destinationFolder}`); CloudRunnerLogger.log(`Pulling from cache ${destinationFolder}`);
if (CloudRunner.buildParameters.cloudRunnerDebugSkipCache) { if (CloudRunner.buildParameters.cloudRunnerDebugSkipCache) {
await new Promise((resolve) => resolve);
return; return;
} }
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');

View File

@ -27,6 +27,7 @@ export class RemoteClient {
CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute), CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute),
); );
const lfsHashes = await LfsHashing.createLFSHashFiles(); const lfsHashes = await LfsHashing.createLFSHashFiles();
CloudRunnerLogger.log(`lfs hash completion: ${lfsHashes.lfsGuid} ${lfsHashes.lfsGuidSum}`);
if (fs.existsSync(CloudRunnerFolders.libraryFolderAbsolute)) { if (fs.existsSync(CloudRunnerFolders.libraryFolderAbsolute)) {
RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`); RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`);
} }

View File

@ -8,25 +8,21 @@ import { CliFunction } from '../../cli/cli-functions-repository';
export class LfsHashing { export class LfsHashing {
public static async createLFSHashFiles() { public static async createLFSHashFiles() {
try { await CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
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`);
await CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`); assert(fs.existsSync(`.lfs-assets-guid-sum`));
assert(fs.existsSync(`.lfs-assets-guid-sum`)); assert(fs.existsSync(`.lfs-assets-guid`));
assert(fs.existsSync(`.lfs-assets-guid`)); const lfsHashes = {
const lfsHashes = { lfsGuid: fs
lfsGuid: fs .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8')
.readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8') .replace(/\n/g, ``),
.replace(/\n/g, ``), lfsGuidSum: fs
lfsGuidSum: fs .readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8')
.readFileSync(`${path.join(CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8') .replace(' .lfs-assets-guid', '')
.replace(' .lfs-assets-guid', '') .replace(/\n/g, ``),
.replace(/\n/g, ``), };
};
return lfsHashes; return lfsHashes;
} catch (error) {
throw error;
}
} }
public static async hashAllFiles(folder: string) { public static async hashAllFiles(folder: string) {
const startPath = process.cwd(); const startPath = process.cwd();