refactor
This commit is contained in:
parent
319902179c
commit
729d401ac3
12 changed files with 77 additions and 32 deletions
19
dist/post/index.js
vendored
19
dist/post/index.js
vendored
|
|
@ -52,6 +52,15 @@ if (diskCacheEnabled) {
|
|||
}
|
||||
}
|
||||
|
||||
const remoteCacheServerUrl = 'http://localhost:9889/cache'
|
||||
const remoteCacheEnabled = core.getBooleanInput('remote-cache')
|
||||
if (remoteCacheEnabled) {
|
||||
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}\n`)
|
||||
if (diskCacheEnabled) {
|
||||
core.error('Disk cache and remote cache cannot be enabled at the same time')
|
||||
}
|
||||
}
|
||||
|
||||
const repositoryCacheConfig = core.getInput('repository-cache')
|
||||
const repositoryCacheEnabled = repositoryCacheConfig !== 'false'
|
||||
let repositoryCacheFiles = [
|
||||
|
|
@ -157,10 +166,10 @@ module.exports = {
|
|||
name: 'repository',
|
||||
paths: [bazelRepository]
|
||||
},
|
||||
remoteCacheServer: {
|
||||
enabled: true,
|
||||
url: 'http://localhost:8080/cache',
|
||||
remoteCache: {
|
||||
enabled: remoteCacheEnabled,
|
||||
logPath: `${os.tmpdir()}/remote-cache-server.log`,
|
||||
url: remoteCacheServerUrl,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95947,7 +95956,9 @@ async function run() {
|
|||
}
|
||||
|
||||
async function stopRemoteCacheServer() {
|
||||
core.info(fs.readFileSync(config.remoteCacheServer.logPath, 'utf8'))
|
||||
if (!config.remoteCacheServer.enabled) {
|
||||
return
|
||||
}
|
||||
|
||||
const pid = core.getState('remote-cache-server-pid')
|
||||
if (pid) {
|
||||
|
|
|
|||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue