Do not contact AWS in offline mode (elastic/x-pack-elasticsearch#1001)

This commit restores the ability to build x-pack-elasticsearch without issues when running without
access to the internet. When the `--offline` flag is used, we will not try to contact vault and the
aws apis to retrieve the ml-cpp binaries but instead gradle will use a cached version even though
it may be expired.

relates elastic/x-pack-elasticsearch#726

Original commit: elastic/x-pack-elasticsearch@b0915d8fa9
This commit is contained in:
Jay Modi 2017-04-08 07:08:28 -06:00 committed by GitHub
parent 10df00beb1
commit cdfcfc5540
1 changed files with 8 additions and 1 deletions

View File

@ -130,7 +130,14 @@ gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(bundlePlugin)) { if (taskGraph.hasTask(bundlePlugin)) {
if (project.hasProperty("mlAwsAccessKey") == false && project.hasProperty("mlAwsSecretKey") == false) { if (project.hasProperty("mlAwsAccessKey") == false && project.hasProperty("mlAwsSecretKey") == false) {
setAwsCreds() if (project.gradle.startParameter.isOffline()) {
// if the project is offline, then we shouldn't try to contact AWS and instead can just
// use a cached, but possibly expired artifact so that the build works...
project.ext.mlAwsAccessKey = ""
project.ext.mlAwsSecretKey = ""
} else {
setAwsCreds()
}
} }
repositories { repositories {