Skip to content

Commit fca458f

Browse files
committed
Use system properties for build cache configuration (#45295)
1 parent e3599fd commit fca458f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.ci/init.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,18 @@ projectsLoaded {
7272
}
7373
}
7474

75-
if (System.env.GRADLE_BUILD_CACHE_URL != null) {
75+
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
76+
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
77+
78+
if (buildCacheUrl) {
7679
final Map<String,String> buildCacheCredentials = vault.logical()
7780
.read("secret/elasticsearch-ci/gradle-build-cache")
7881
.getData();
7982
gradle.settingsEvaluated { settings ->
8083
settings.buildCache {
8184
remote(HttpBuildCache) {
82-
url = System.getenv('GRADLE_BUILD_CACHE_URL')
83-
push = Boolean.valueOf(System.getenv('GRADLE_BUILD_CACHE_PUSH') ?: 'false')
85+
url = buildCacheUrl
86+
push = buildCachePush
8487
credentials {
8588
username = buildCacheCredentials.get("username")
8689
password = buildCacheCredentials.get("password")

0 commit comments

Comments
 (0)