From: Simon Brandhof Date: Tue, 19 Feb 2019 15:08:01 +0000 (+0100) Subject: Apply the Cirrus guidelines about Gradle cache X-Git-Tag: 7.7~136 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd12d0fa7b9ba4a9cb23313b375d94df55c7b0d9;p=sonarqube.git Apply the Cirrus guidelines about Gradle cache --- 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 } }