Skip to content

Commit

Permalink
Set remote build cache to push only if authenticated (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribafish authored Dec 14, 2023
1 parent 211f082 commit 8ace25f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gradle/gradle-enterprise.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ buildCache {
local.enabled = true
remote(HttpBuildCache) {
url = 'https://caffeine.gradle-enterprise.cloud/cache/'
push = System.env.CI
enabled = true
def cachePassword = settings.ext.find('gradleEnterpriseCachePassword')
?: System.env.GRADLE_ENTERPRISE_CACHE_PASSWORD
// Check cache password presence to avoid build cache errors on PR builds when not present
push = System.env.CI && cachePassword
credentials {
username = 'ci'
password = settings.ext.find('gradleEnterpriseCachePassword')
?: System.env.GRADLE_ENTERPRISE_CACHE_PASSWORD
password = cachePassword
}
}
}

0 comments on commit 8ace25f

Please sign in to comment.