Skip to content

Commit

Permalink
Update to use access key authentication for Develocity build cache (#…
Browse files Browse the repository at this point in the history
…4044)

Co-authored-by: Tim te Beek <[email protected]>
  • Loading branch information
tylerbertrand and timtebeek authored Feb 24, 2024
1 parent d85761f commit b433583
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
uses: openrewrite/gh-automation/.github/workflows/ci-gradle.yml@main
secrets:
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
gradle_enterprise_cache_username: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
gradle_enterprise_cache_password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
ossrh_token: ${{ secrets.OSSRH_TOKEN }}
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
uses: openrewrite/gh-automation/.github/workflows/ci-gradle.yml@main
secrets:
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
gradle_enterprise_cache_username: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
gradle_enterprise_cache_password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
ossrh_token: ${{ secrets.OSSRH_TOKEN }}
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
Expand Down
15 changes: 4 additions & 11 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,12 @@ plugins {
gradleEnterprise {
val isCiServer = System.getenv("CI")?.equals("true") ?: false
server = "https://ge.openrewrite.org/"
val gradleCacheRemoteUsername: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME")
val gradleCacheRemotePassword: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")

buildCache {
remote(HttpBuildCache::class) {
url = uri("https://ge.openrewrite.org/cache/")
if (!gradleCacheRemoteUsername.isNullOrBlank() && !gradleCacheRemotePassword.isNullOrBlank()) {
isPush = isCiServer
credentials {
username = gradleCacheRemoteUsername
password = gradleCacheRemotePassword
}
}
remote(gradleEnterprise.buildCache) {
isEnabled = true
val accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY")
isPush = isCiServer && !accessKey.isNullOrBlank()
}
}

Expand Down

0 comments on commit b433583

Please sign in to comment.