forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gradle init script for enabling remote build cache (elastic#42484)
- Loading branch information
1 parent
0715cc2
commit 4b1db99
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if (System.getenv('GRADLE_BUILD_CACHE_URL')) { | ||
gradle.settingsEvaluated { settings -> | ||
settings.buildCache { | ||
remote(HttpBuildCache) { | ||
url = System.getenv('GRADLE_BUILD_CACHE_URL') | ||
push = Boolean.valueOf(System.getenv('GRADLE_BUILD_CACHE_PUSH') ?: 'false') | ||
if (System.getenv('GRADLE_BUILD_CACHE_USERNAME') && System.getenv('GRADLE_BUILD_CACHE_PASSWORD')) { | ||
credentials { | ||
username = System.getenv('GRADLE_BUILD_CACHE_USERNAME') | ||
password = System.getenv('GRADLE_BUILD_CACHE_PASSWORD') | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
throw new GradleException("You must supply a value for GRADLE_BUILD_CACHE_URL environment variable when applying build-cache.gradle init script") | ||
} |