Skip to content

Commit

Permalink
Disable the use of artifactory in CI (#47100)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpar-t committed Sep 25, 2019
1 parent 11d3046 commit a439743
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions .ci/init.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ initscript {
}
}

boolean USE_ARTIFACTORY=false

['VAULT_ADDR', 'VAULT_ROLE_ID', 'VAULT_SECRET_ID'].each {
if (System.env."$it" == null) {
throw new GradleException("$it must be set!")
Expand Down Expand Up @@ -37,46 +39,52 @@ final Vault vault = new Vault(
)
.withRetries(5, 1000)

final Map<String,String> artifactoryCredentials = vault.logical()
.read("secret/elasticsearch-ci/artifactory.elstc.co")
.getData();

logger.info("Using elastic artifactory repos")
Closure configCache = {
return {
name "artifactory-gradle-release"
url "https://artifactory.elstc.co/artifactory/gradle-release"
credentials {
username artifactoryCredentials.get("username")
password artifactoryCredentials.get("token")
if (USE_ARTIFACTORY) {
final Map<String,String> artifactoryCredentials = vault.logical()
.read("secret/elasticsearch-ci/artifactory.elstc.co")
.getData();
logger.info("Using elastic artifactory repos")
Closure configCache = {
return {
name "artifactory-gradle-release"
url "https://artifactory.elstc.co/artifactory/gradle-release"
credentials {
username artifactoryCredentials.get("username")
password artifactoryCredentials.get("token")
}
}
}
}
settingsEvaluated { settings ->
settings.pluginManagement {
repositories {
maven configCache()
settingsEvaluated { settings ->
settings.pluginManagement {
repositories {
maven configCache()
}
}
}
}
projectsLoaded {
allprojects {
buildscript {
projectsLoaded {
allprojects {
buildscript {
repositories {
maven configCache()
}
}
repositories {
maven configCache()
}
}
repositories {
maven configCache()
}
}
}

projectsLoaded {
rootProject {
project.pluginManager.withPlugin('com.gradle.build-scan') {
buildScan.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'))

Expand Down

0 comments on commit a439743

Please sign in to comment.