]> source.dussan.org Git - sonarqube.git/commitdiff
Apply the Cirrus guidelines about Gradle cache
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 19 Feb 2019 15:08:01 +0000 (16:08 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 19 Feb 2019 19:20:55 +0000 (20:20 +0100)
settings.gradle

index 9ab4a914693a3f7ed595cc6bf21a92e6d3075a9c..584f6792517294edbf959d152c78e3226014fb2f 100644 (file)
@@ -37,15 +37,16 @@ if (extraSettings.exists()) {
   apply from: extraSettings
 }
 
-ext.isCiServer = System.getenv().containsKey("CI")
-ext.buildCacheHost = System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321")
+ext.isCiServer = System.getenv().containsKey("CIRRUS_CI")
+ext.isMasterBranch = System.getenv()["CIRRUS_BRANCH"] == "master"
+
 buildCache {
   local {
     enabled = !isCiServer
   }
   remote(HttpBuildCache) {
-    url = "http://" + buildCacheHost + "/"
+    url = 'http://' + System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321") + "/"
     enabled = isCiServer
-    push = true
+    push = isMasterBranch
   }
 }