Commit 29114e16 authored by Vincent Massol's avatar Vincent Massol
Browse files

XINFRA-338: Add a Gradle Enterprise cache for faster builds

* Enable remote cache + store CI build results in the remote cache
* Only publish build scans on CI or on demand on dev machines
parent 8bfa3468
......@@ -28,18 +28,28 @@
</server>
<buildScan>
<publishIfAuthenticated>true</publishIfAuthenticated>
<publish>ALWAYS</publish>
<!-- Always publish build scans on CI but on demand for devs so that we don't get false positives on ge.xwiki.org
due to local changes from users and so that it doesn't pollute the ge.xwiki.org data.
To force publishing a build scan: -Dscan -->
<publish>#{env['CI'] == null ? 'ON_DEMAND' : 'ALWAYS'}</publish>
<captureGoalInputFiles>true</captureGoalInputFiles>
<!-- Use background scans only locally to avoid potential issues on CI (the ephemeral docker agent could terminate
as soon as the build is finished and thus the upload may be terminated before it completes) -->
<backgroundBuildScanUpload>#{env['CI'] == null}</backgroundBuildScanUpload>
</buildScan>
<buildCache>
<!-- Notes:
* To disable the local build cache on the command line, pass: -Dgradle.cache.local.enabled=false
* We disable the local build cache on CI since our agents are transients and isolated, and thus it would cost
more to save the goal outputs since they're not going to be re-used.
-->
<local>
<enabled>true</enabled>
<enabled>#{env['CI'] == null}</enabled>
</local>
<remote>
<enabled>false</enabled>
<enabled>true</enabled>
<!-- Only CI jobs are allowed to store build outputs in the remote cache -->
<storeEnabled>#{env['CI'] != null}</storeEnabled>
</remote>
</buildCache>
</gradleEnterprise>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment