Skip to content

Commit ac7604f

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

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.ci/init.gradle

+6-3
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,18 @@ projectsLoaded {
7777
}
7878
}
7979

80-
if (System.env.GRADLE_BUILD_CACHE_URL != null) {
80+
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
81+
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
82+
83+
if (buildCacheUrl) {
8184
final Map<String,String> buildCacheCredentials = vault.logical()
8285
.read("secret/elasticsearch-ci/gradle-build-cache")
8386
.getData();
8487
gradle.settingsEvaluated { settings ->
8588
settings.buildCache {
8689
remote(HttpBuildCache) {
87-
url = System.getenv('GRADLE_BUILD_CACHE_URL')
88-
push = Boolean.valueOf(System.getenv('GRADLE_BUILD_CACHE_PUSH') ?: 'false')
90+
url = buildCacheUrl
91+
push = buildCachePush
8992
credentials {
9093
username = buildCacheCredentials.get("username")
9194
password = buildCacheCredentials.get("password")

0 commit comments

Comments
 (0)