mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 04:58:50 +00:00
2b34923541
The script will be use in CI to configure our own Artifactory instance so CI does not depend on external network resources nor do we generate excessive load on these resources. In case the repo is not accessible Gradle should fall back to using the public ones.
44 lines
1.6 KiB
Groovy
44 lines
1.6 KiB
Groovy
if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFACTORY_TOKEN == null) {
|
|
throw new GradleException("Using init script without configuration")
|
|
} else {
|
|
logger.info("Using elastic artifactory repos")
|
|
settingsEvaluated { settings ->
|
|
settings.pluginManagement {
|
|
repositories {
|
|
maven {
|
|
url "https://artifactory.elstc.co/artifactory/gradle-plugins"
|
|
credentials {
|
|
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
|
password System.env.ELASTIC_ARTIFACTORY_TOKEN
|
|
}
|
|
}
|
|
gradlePluginPortal()
|
|
}
|
|
}
|
|
}
|
|
projectsLoaded {
|
|
allprojects {
|
|
buildscript {
|
|
repositories {
|
|
maven {
|
|
url "https://artifactory.elstc.co/artifactory/gradle-release/"
|
|
credentials {
|
|
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
|
password System.env.ELASTIC_ARTIFACTORY_TOKEN
|
|
}
|
|
}
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url "https://artifactory.elstc.co/artifactory/gradle-release/"
|
|
credentials {
|
|
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
|
password System.env.ELASTIC_ARTIFACTORY_TOKEN
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|