Fix lib caching
parent
3f9ebcb203
commit
e82f003015
|
|
@ -544,6 +544,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.SetupRemoteRepository = void 0;
|
exports.SetupRemoteRepository = void 0;
|
||||||
|
const console_1 = __webpack_require__(57082);
|
||||||
const fs_1 = __importDefault(__webpack_require__(35747));
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
||||||
const path_1 = __importDefault(__webpack_require__(85622));
|
const path_1 = __importDefault(__webpack_require__(85622));
|
||||||
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||||
|
|
@ -615,7 +616,7 @@ class SetupRemoteRepository {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
process.chdir(`${cloud_runner_state_1.CloudRunnerState.lfsDirectory}/..`);
|
process.chdir(`${cloud_runner_state_1.CloudRunnerState.lfsDirectory}/..`);
|
||||||
yield remote_client_system_1.RemoteClientSystem.Run(`zip -r "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "lfs"`);
|
yield remote_client_system_1.RemoteClientSystem.Run(`zip -r "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "lfs"`);
|
||||||
cloud_runner_logger_1.default.logCli(fs_1.default.existsSync(`${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`).toString());
|
console_1.assert(fs_1.default.existsSync(`${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`));
|
||||||
yield remote_client_system_1.RemoteClientSystem.Run(`cp "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "${path_1.default.join(lfsCacheFolder, `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`)}"`);
|
yield remote_client_system_1.RemoteClientSystem.Run(`cp "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "${path_1.default.join(lfsCacheFolder, `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`)}"`);
|
||||||
cloud_runner_logger_1.default.logCli(`copied ${SetupRemoteRepository.LFS_ASSETS_HASH} to ${lfsCacheFolder}`);
|
cloud_runner_logger_1.default.logCli(`copied ${SetupRemoteRepository.LFS_ASSETS_HASH} to ${lfsCacheFolder}`);
|
||||||
});
|
});
|
||||||
|
|
@ -640,7 +641,7 @@ class SetupRemoteRepository {
|
||||||
latestLFSCacheFile = `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`;
|
latestLFSCacheFile = `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
latestLFSCacheFile = yield remote_client_system_1.RemoteClientSystem.Run(`ls -t "${lfsCacheFolder}" | grep .zip$ | head -1`);
|
latestLFSCacheFile = yield (yield remote_client_system_1.RemoteClientSystem.Run(`ls -t "${lfsCacheFolder}" | grep .zip$ | head -1`)).replace(`\n`, ``);
|
||||||
}
|
}
|
||||||
if (fs_1.default.existsSync(latestLFSCacheFile)) {
|
if (fs_1.default.existsSync(latestLFSCacheFile)) {
|
||||||
cloud_runner_logger_1.default.logCli(`LFS cache exists`);
|
cloud_runner_logger_1.default.logCli(`LFS cache exists`);
|
||||||
|
|
@ -266322,6 +266323,14 @@ module.exports = require("child_process");;
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 57082:
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
module.exports = require("console");;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 33373:
|
/***/ 33373:
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { assert } from 'console';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import CloudRunnerLogger from '../../cloud-runner/services/cloud-runner-logger';
|
import CloudRunnerLogger from '../../cloud-runner/services/cloud-runner-logger';
|
||||||
|
|
@ -73,6 +74,7 @@ export class SetupRemoteRepository {
|
||||||
private static async cacheLatestLFSFiles(lfsCacheFolder: string) {
|
private static async cacheLatestLFSFiles(lfsCacheFolder: string) {
|
||||||
process.chdir(`${CloudRunnerState.lfsDirectory}/..`);
|
process.chdir(`${CloudRunnerState.lfsDirectory}/..`);
|
||||||
await RemoteClientSystem.Run(`zip -r "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "lfs"`);
|
await RemoteClientSystem.Run(`zip -r "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "lfs"`);
|
||||||
|
assert();
|
||||||
CloudRunnerLogger.logCli(fs.existsSync(`${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`).toString());
|
CloudRunnerLogger.logCli(fs.existsSync(`${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`).toString());
|
||||||
await RemoteClientSystem.Run(
|
await RemoteClientSystem.Run(
|
||||||
`cp "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "${path.join(
|
`cp "${SetupRemoteRepository.LFS_ASSETS_HASH}.zip" "${path.join(
|
||||||
|
|
@ -100,7 +102,9 @@ export class SetupRemoteRepository {
|
||||||
CloudRunnerLogger.logCli(`Match found: using large file hash match ${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`);
|
CloudRunnerLogger.logCli(`Match found: using large file hash match ${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`);
|
||||||
latestLFSCacheFile = `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`;
|
latestLFSCacheFile = `${SetupRemoteRepository.LFS_ASSETS_HASH}.zip`;
|
||||||
} else {
|
} else {
|
||||||
latestLFSCacheFile = await RemoteClientSystem.Run(`ls -t "${lfsCacheFolder}" | grep .zip$ | head -1`);
|
latestLFSCacheFile = await (
|
||||||
|
await RemoteClientSystem.Run(`ls -t "${lfsCacheFolder}" | grep .zip$ | head -1`)
|
||||||
|
).replace(`\n`, ``);
|
||||||
}
|
}
|
||||||
if (fs.existsSync(latestLFSCacheFile)) {
|
if (fs.existsSync(latestLFSCacheFile)) {
|
||||||
CloudRunnerLogger.logCli(`LFS cache exists`);
|
CloudRunnerLogger.logCli(`LFS cache exists`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue