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
}
}