From cdfcfc5540ac2e34df2137e3e896d96897777633 Mon Sep 17 00:00:00 2001 From: Jay Modi Date: Sat, 8 Apr 2017 07:08:28 -0600 Subject: [PATCH] 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@b0915d8fa946c03c70adfd2871ff73996f552bda --- plugin/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin/build.gradle b/plugin/build.gradle index e71685db485..2bc91e51b28 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -130,7 +130,14 @@ gradle.taskGraph.whenReady { taskGraph -> if (taskGraph.hasTask(bundlePlugin)) { 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 {