Fix lib caching
parent
9a2757e69f
commit
e57d9d0a83
|
|
@ -669,7 +669,7 @@ class SetupRemoteRepository {
|
||||||
yield remote_client_system_1.RemoteClientSystem.Run(`ls -lh "${libraryCacheFolder}"`);
|
yield remote_client_system_1.RemoteClientSystem.Run(`ls -lh "${libraryCacheFolder}"`);
|
||||||
cloud_runner_logger_1.default.logCli(`Checking if Library cache ${libraryCacheFolder}/${latestLibraryCacheFile} exists`);
|
cloud_runner_logger_1.default.logCli(`Checking if Library cache ${libraryCacheFolder}/${latestLibraryCacheFile} exists`);
|
||||||
const latestCacheFilePath = path_1.default.join(libraryCacheFolder, latestLibraryCacheFile);
|
const latestCacheFilePath = path_1.default.join(libraryCacheFolder, latestLibraryCacheFile);
|
||||||
if (fs_1.default.existsSync(latestCacheFilePath)) {
|
if (yield SetupRemoteRepository.checkFileExists(latestCacheFilePath)) {
|
||||||
cloud_runner_logger_1.default.logCli(`Library cache exists`);
|
cloud_runner_logger_1.default.logCli(`Library cache exists`);
|
||||||
yield remote_client_system_1.RemoteClientSystem.Run(`unzip -q "${latestCacheFilePath}" -d "$projectPathFull"`);
|
yield remote_client_system_1.RemoteClientSystem.Run(`unzip -q "${latestCacheFilePath}" -d "$projectPathFull"`);
|
||||||
}
|
}
|
||||||
|
|
@ -681,6 +681,13 @@ class SetupRemoteRepository {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static checkFileExists(filepath) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
fs_1.default.access(filepath, fs_1.default.constants.F_OK, (error) => {
|
||||||
|
resolve(!error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
static createLFSHashFiles() {
|
static createLFSHashFiles() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield remote_client_system_1.RemoteClientSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
yield remote_client_system_1.RemoteClientSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -132,7 +132,7 @@ export class SetupRemoteRepository {
|
||||||
await RemoteClientSystem.Run(`ls -lh "${libraryCacheFolder}"`);
|
await RemoteClientSystem.Run(`ls -lh "${libraryCacheFolder}"`);
|
||||||
CloudRunnerLogger.logCli(`Checking if Library cache ${libraryCacheFolder}/${latestLibraryCacheFile} exists`);
|
CloudRunnerLogger.logCli(`Checking if Library cache ${libraryCacheFolder}/${latestLibraryCacheFile} exists`);
|
||||||
const latestCacheFilePath = path.join(libraryCacheFolder, latestLibraryCacheFile);
|
const latestCacheFilePath = path.join(libraryCacheFolder, latestLibraryCacheFile);
|
||||||
if (fs.existsSync(latestCacheFilePath)) {
|
if (await SetupRemoteRepository.checkFileExists(latestCacheFilePath)) {
|
||||||
CloudRunnerLogger.logCli(`Library cache exists`);
|
CloudRunnerLogger.logCli(`Library cache exists`);
|
||||||
await RemoteClientSystem.Run(`unzip -q "${latestCacheFilePath}" -d "$projectPathFull"`);
|
await RemoteClientSystem.Run(`unzip -q "${latestCacheFilePath}" -d "$projectPathFull"`);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -142,6 +142,13 @@ export class SetupRemoteRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static checkFileExists(filepath) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
fs.access(filepath, fs.constants.F_OK, (error) => {
|
||||||
|
resolve(!error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private static async createLFSHashFiles() {
|
private static async createLFSHashFiles() {
|
||||||
await RemoteClientSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
await RemoteClientSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue