aboutsummaryrefslogtreecommitdiffstats
path: root/settings.gradle
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2019-02-19 16:08:01 +0100
committerSonarTech <sonartech@sonarsource.com>2019-02-19 20:20:55 +0100
commitbd12d0fa7b9ba4a9cb23313b375d94df55c7b0d9 (patch)
tree4a250e98bd961b1cec1c55705293e3b68c728464 /settings.gradle
parentc0d01d9fab577c33f27d4b3342683f9c6ecec4a1 (diff)
downloadsonarqube-bd12d0fa7b9ba4a9cb23313b375d94df55c7b0d9.tar.gz
sonarqube-bd12d0fa7b9ba4a9cb23313b375d94df55c7b0d9.zip
Apply the Cirrus guidelines about Gradle cache
Diffstat (limited to 'settings.gradle')
-rw-r--r--settings.gradle9
1 files changed, 5 insertions, 4 deletions
diff --git a/settings.gradle b/settings.gradle
index 9ab4a914693..584f6792517 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -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
}
}