Simple override cache push
parent
035e59e774
commit
a8be343564
|
|
@ -628,10 +628,19 @@ class Caching {
|
|||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${path_1.default.basename(sourceFolder)}`);
|
||||
}
|
||||
// eslint-disable-next-line func-style
|
||||
const formatFunction = function (format) {
|
||||
const arguments_ = Array.prototype.slice.call([path_1.default.resolve(sourceFolder, '..'), cacheFolder], 1);
|
||||
return format.replace(/{(\d+)}/g, function (match, number) {
|
||||
return typeof arguments_[number] != 'undefined' ? arguments_[number] : match;
|
||||
});
|
||||
};
|
||||
yield cloud_runner_system_1.CloudRunnerSystem.Run(`zip ${cacheKey}.zip ${path_1.default.basename(sourceFolder)}`);
|
||||
console_1.assert(fs_1.default.existsSync(`${cacheKey}.zip`), 'cache zip exists');
|
||||
console_1.assert(fs_1.default.existsSync(path_1.default.basename(sourceFolder)), 'source folder exists');
|
||||
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`);
|
||||
yield (process.env.CLOUD_RUNNER_OVERRIDE_CACHE_PUSH
|
||||
? cloud_runner_system_1.CloudRunnerSystem.Run(formatFunction(process.env.CLOUD_RUNNER_OVERRIDE_CACHE_PUSH))
|
||||
: cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`));
|
||||
remote_client_logger_1.RemoteClientLogger.log(`moved ${cacheKey}.zip to ${cacheFolder}`);
|
||||
console_1.assert(fs_1.default.existsSync(`${path_1.default.join(cacheFolder, cacheKey)}.zip`), 'cache zip exists inside cache folder');
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -28,10 +28,19 @@ export class Caching {
|
|||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerSystem.Run(`ls ${path.basename(sourceFolder)}`);
|
||||
}
|
||||
// eslint-disable-next-line func-style
|
||||
const formatFunction = function (format: string) {
|
||||
const arguments_ = Array.prototype.slice.call([path.resolve(sourceFolder, '..'), cacheFolder], 1);
|
||||
return format.replace(/{(\d+)}/g, function (match, number) {
|
||||
return typeof arguments_[number] != 'undefined' ? arguments_[number] : match;
|
||||
});
|
||||
};
|
||||
await CloudRunnerSystem.Run(`zip ${cacheKey}.zip ${path.basename(sourceFolder)}`);
|
||||
assert(fs.existsSync(`${cacheKey}.zip`), 'cache zip exists');
|
||||
assert(fs.existsSync(path.basename(sourceFolder)), 'source folder exists');
|
||||
await CloudRunnerSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`);
|
||||
await (process.env.CLOUD_RUNNER_OVERRIDE_CACHE_PUSH
|
||||
? CloudRunnerSystem.Run(formatFunction(process.env.CLOUD_RUNNER_OVERRIDE_CACHE_PUSH))
|
||||
: CloudRunnerSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`));
|
||||
RemoteClientLogger.log(`moved ${cacheKey}.zip to ${cacheFolder}`);
|
||||
assert(fs.existsSync(`${path.join(cacheFolder, cacheKey)}.zip`), 'cache zip exists inside cache folder');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue