This commit is contained in:
Alex Rodionov 2024-05-30 13:32:14 -07:00
parent 8883487425
commit ef78fd9c8a
7 changed files with 82000 additions and 5 deletions

25
dist/post/index.js vendored
View file

@ -157,6 +157,11 @@ module.exports = {
name: 'repository',
paths: [bazelRepository]
},
remoteCacheServer: {
enabled: true,
url: 'http://localhost:8080/cache',
logPath: `${os.tmpdir()}/remote-cache-server.log`,
}
}
@ -95935,11 +95940,31 @@ const core = __nccwpck_require__(2186)
const glob = __nccwpck_require__(8090)
const config = __nccwpck_require__(5532)
const { getFolderSize } = __nccwpck_require__(4962)
const { execSync } = __nccwpck_require__(2081)
async function run() {
await stopRemoteCacheServer()
await saveCaches()
}
async function stopRemoteCacheServer() {
const pid = core.getState('remote-cache-server-pid')
if (pid) {
try {
process.kill(pid, 'SIGTERM')
core.debug(`Stopped remote cache server with PID: ${pid}`)
} catch (error) {
core.error(`Failed to stop remote cache server with PID: ${pid}. Error: ${error}`)
}
}
const logPath = config.remoteCacheServer.logPath
if (fs.existsSync(logPath)) {
const logContent = fs.readFileSync(logPath, 'utf8')
core.debug(`Remote cache server log:\n${logContent}`)
}
}
async function saveCaches() {
await saveCache(config.bazeliskCache)
await saveCache(config.diskCache)

File diff suppressed because one or more lines are too long