提交 1a54b83a 编写于 作者: A Andy Wilkinson 提交者: Sam Brannen

Add opt-in support for remote build cache and pushing to it from CI

This commit provides opt-in enablement of Gradle's remote build
cache. When the GRADLE_ENTERPRISE_URL environment variable is set, its
build cache node will be used as a source of cached output. If both
GRADLE_ENTERPRISE_CACHE_USERNAME and GRADLE_ENTERPRISE_CACHE_PASSWORD
are also set, task output produced by the build will be pushed to the
build cache node for use by subsequent builds.

Closes gh-23883
上级 0cea49fd
......@@ -2,7 +2,19 @@ buildCache {
local {
enabled = true
}
remote(HttpBuildCache) {
enabled = false
if (System.getenv('GRADLE_ENTERPRISE_URL')) {
remote(HttpBuildCache) {
enabled = true
url = "${System.getenv('GRADLE_ENTERPRISE_URL')}/cache/"
def cacheUsername = System.getenv('GRADLE_ENTERPRISE_CACHE_USERNAME')
def cachePassword = System.getenv('GRADLE_ENTERPRISE_CACHE_PASSWORD')
if (cacheUsername && cachePassword) {
push = true
credentials {
username = cacheUsername
password = cachePassword
}
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册