hashing driven enhancement for cache

pull/310/head
Frostebite 2022-01-01 03:03:04 +00:00
parent feafcc8371
commit ede387eed3
5 changed files with 9 additions and 5 deletions

6
dist/index.js vendored
View File

@ -538,7 +538,7 @@ class Caching {
}
process.chdir(`${sourceFolder}/..`);
if (__1.Input.cloudRunnerTests) {
cloud_runner_logger_1.default.log(yield lfs_hashing_1.LFSHashing.hashAllFiles(sourceFolder));
cloud_runner_logger_1.default.log(`Hashed cache folder ${yield lfs_hashing_1.LFSHashing.hashAllFiles(sourceFolder)}`);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${sourceFolder}`);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
}
@ -747,7 +747,9 @@ class LFSHashing {
static hashAllFiles(folder) {
return __awaiter(this, void 0, void 0, function* () {
process.chdir(`${folder}`);
return yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`find -type f -exec md5sum "{}" + | sort`);
return yield (yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '')
.split(` `)[0];
});
}
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ export class Caching {
process.chdir(`${sourceFolder}/..`);
if (Input.cloudRunnerTests) {
CloudRunnerLogger.log(await LFSHashing.hashAllFiles(sourceFolder));
CloudRunnerLogger.log(`Hashed cache folder ${await LFSHashing.hashAllFiles(sourceFolder)}`);
await CloudRunnerAgentSystem.Run(`tree ${sourceFolder}`);
await CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
}

View File

@ -32,6 +32,8 @@ export class LFSHashing {
}
public static async hashAllFiles(folder: string) {
process.chdir(`${folder}`);
return await CloudRunnerAgentSystem.Run(`find -type f -exec md5sum "{}" + | sort`);
return await (await CloudRunnerAgentSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '')
.split(` `)[0];
}
}

0
test.txt 100644
View File