Adds ability to specify the aws credentials as environment variables

Original commit: elastic/x-pack-elasticsearch@c22428069e
This commit is contained in:
Colin Goodheart-Smithe 2016-12-05 13:58:18 +00:00
parent d3b4261759
commit 3f35eac183
1 changed files with 9 additions and 4 deletions

View File

@ -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()