Skip to content

Commit

Permalink
Fall back to develocity.server for cache server
Browse files Browse the repository at this point in the history
When the cache server hasn't been explicitly configured, we should
fall back to using the value of develocity.server. Doing so will make
it easier to use a  Develocity instance other than ge.spring.io as
only develocity.server has to be configured.

Closes gh-78
  • Loading branch information
wilkinsona committed May 7, 2024
1 parent 3062bd4 commit c86134a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ public void execute(BuildCacheConfiguration buildCache) {
String cacheServer = this.env.get("DEVELOCITY_CACHE_SERVER");
if (cacheServer == null) {
cacheServer = serverOfCacheUrl(this.env.get("GRADLE_ENTERPRISE_CACHE_URL"));
if (cacheServer == null) {
cacheServer = "https://ge.spring.io";
}
}
remote.setServer(cacheServer);
if (cacheServer != null) {
remote.setServer(cacheServer);
}
String accessKey = this.env.get("DEVELOCITY_ACCESS_KEY");
if (accessKey == null) {
accessKey = this.env.get("GRADLE_ENTERPRISE_ACCESS_KEY");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void localCacheIsEnabled() {
void remoteCacheIsEnabled() {
new BuildCacheConventions(DevelocityBuildCache.class).execute(this.buildCache);
assertThat(this.buildCache.remote.isEnabled()).isTrue();
assertThat(this.buildCache.remote.getServer()).isEqualTo("https://ge.spring.io");
assertThat(this.buildCache.remote.getServer()).isNull();
assertThat(this.buildCache.remote.isPush()).isFalse();
}

Expand Down

0 comments on commit c86134a

Please sign in to comment.