Browse Source

Use system properties for build cache configuration (#45295)

Mark Vieira 6 years ago
parent
commit
664a29c890
1 changed files with 6 additions and 3 deletions
  1. 6 3
      .ci/init.gradle

+ 6 - 3
.ci/init.gradle

@@ -77,15 +77,18 @@ projectsLoaded {
     }
 }
 
-if (System.env.GRADLE_BUILD_CACHE_URL != null) {
+final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
+final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
+
+if (buildCacheUrl) {
     final Map<String,String> buildCacheCredentials = vault.logical()
             .read("secret/elasticsearch-ci/gradle-build-cache")
             .getData();
     gradle.settingsEvaluated { settings ->
         settings.buildCache {
             remote(HttpBuildCache) {
-                url = System.getenv('GRADLE_BUILD_CACHE_URL')
-                push = Boolean.valueOf(System.getenv('GRADLE_BUILD_CACHE_PUSH') ?: 'false')
+                url = buildCacheUrl
+                push = buildCachePush
                 credentials {
                         username = buildCacheCredentials.get("username")
                         password = buildCacheCredentials.get("password")