From 3f35eac1837dbb27283b654a134b42a0a4571b92 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Mon, 5 Dec 2016 13:58:18 +0000 Subject: [PATCH] Adds ability to specify the aws credentials as environment variables Original commit: elastic/x-pack-elasticsearch@c22428069e46bcf3610324f90670c9ad61aa19c9 --- build.gradle | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 66352504af2..bcd99293663 100644 --- a/build.gradle +++ b/build.gradle @@ -6,15 +6,20 @@ import org.elasticsearch.gradle.precommit.LicenseHeadersTask import org.elasticsearch.gradle.VersionProperties import org.elastic.gradle.UploadS3Task -if (project.hasProperty("AWS_ACCESS_KEY")) { +String envAwsAccessKey = System.env.AWS_ACCESS_KEY +if (envAwsAccessKey != null) { + project.ext.awsAccessKey = envAwsAccessKey +} else if (project.hasProperty("AWS_ACCESS_KEY")) { project.ext.awsAccessKey = AWS_ACCESS_KEY } -if (project.hasProperty("AWS_SECRET_KEY")) { -project.ext.awsSecretKey = AWS_SECRET_KEY +String envAwsSecretKey = System.env.AWS_SECRET_KEY +if (envAwsSecretKey != null) { + project.ext.awsSecretKey = envAwsSecretKey +} else if (project.hasProperty("AWS_SECRET_KEY")) { + project.ext.awsSecretKey = AWS_SECRET_KEY } - project.ext.isWindows = OperatingSystem.current().isWindows() project.ext.isLinux = OperatingSystem.current().isLinux() project.ext.isMacOsX = OperatingSystem.current().isMacOsX()