mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-19 04:45:07 -04:00
[BUILD] Rework build cache authentication on CI (#122296)
This is required to update to newer version of gradle enterprise and the gradle enterprise plugin.
This commit is contained in:
parent
66d18d03d4
commit
9c19538c06
5 changed files with 31 additions and 22 deletions
|
@ -44,6 +44,9 @@ export GRADLE_BUILD_CACHE_USERNAME
|
|||
GRADLE_BUILD_CACHE_PASSWORD=$(vault read -field=password secret/ci/elastic-elasticsearch/migrated/gradle-build-cache)
|
||||
export GRADLE_BUILD_CACHE_PASSWORD
|
||||
|
||||
DEVELOCITY_ACCESS_KEY="gradle-enterprise.elastic.co=$(vault read -field=accesskey secret/ci/elastic-elasticsearch/migrated/gradle-build-cache)"
|
||||
export DEVELOCITY_ACCESS_KEY
|
||||
|
||||
BUILDKITE_API_TOKEN=$(vault read -field=token secret/ci/elastic-elasticsearch/buildkite-api-token)
|
||||
export BUILDKITE_API_TOKEN
|
||||
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
gradle.settingsEvaluated { settings ->
|
||||
settings.pluginManager.withPlugin("com.gradle.develocity") {
|
||||
settings.develocity {
|
||||
server = 'https://gradle-enterprise.elastic.co'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
|
||||
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
|
||||
|
||||
if (buildCacheUrl) {
|
||||
gradle.settingsEvaluated { settings ->
|
||||
settings.buildCache {
|
||||
local {
|
||||
// Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty
|
||||
enabled = false
|
||||
}
|
||||
remote(HttpBuildCache) {
|
||||
url = buildCacheUrl
|
||||
push = buildCachePush
|
||||
credentials {
|
||||
username = System.getenv("GRADLE_BUILD_CACHE_USERNAME")
|
||||
password = System.getenv("GRADLE_BUILD_CACHE_PASSWORD")
|
||||
gradle.settingsEvaluated { settings ->
|
||||
settings.pluginManager.withPlugin("com.gradle.develocity") {
|
||||
settings.develocity {
|
||||
server = "https://gradle-enterprise.elastic.co"
|
||||
}
|
||||
if (buildCacheUrl) {
|
||||
settings.buildCache {
|
||||
local {
|
||||
// Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty
|
||||
enabled = false
|
||||
}
|
||||
remote(settings.develocity.buildCache) {
|
||||
enabled = true
|
||||
push = buildCachePush
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.18.1"
|
||||
}
|
||||
|
||||
rootProject.name = 'build-conventions'
|
||||
|
||||
dependencyResolutionManagement {
|
||||
|
|
|
@ -8,6 +8,10 @@ pluginManagement {
|
|||
includeBuild "../build-tools"
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.18.1"
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
buildLibs {
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
pluginManagement {
|
||||
includeBuild "../build-conventions"
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.18.1"
|
||||
}
|
||||
include 'reaper'
|
||||
|
||||
dependencyResolutionManagement {
|
||||
|
|
Loading…
Add table
Reference in a new issue