change aws cred properties
Changing properties to `PRELERT_AWS_ACCESS_KEY_ID` and `PRELERT_AWS_SECRET_ACCESS_KEY` to avoid conflicts on the ci servers Original commit: elastic/x-pack-elasticsearch@2b90e752f1
This commit is contained in:
parent
2f3e5af046
commit
3eb3b7f38d
32
build.gradle
32
build.gradle
|
@ -6,24 +6,24 @@ import org.elasticsearch.gradle.precommit.LicenseHeadersTask
|
||||||
import org.elasticsearch.gradle.VersionProperties
|
import org.elasticsearch.gradle.VersionProperties
|
||||||
import org.elastic.gradle.UploadS3Task
|
import org.elastic.gradle.UploadS3Task
|
||||||
|
|
||||||
String envAwsAccessKey = System.env.AWS_ACCESS_KEY_ID
|
String envPrelertAwsAccessKey = System.env.PRELERT_AWS_ACCESS_KEY_ID
|
||||||
print 'BUILD - System.env.AWS_ACCESS_KEY_ID: ' + envAwsAccessKey + '\n'
|
print 'BUILD - System.env.PRELERT_AWS_ACCESS_KEY_ID: ' + envPrelertAwsAccessKey + '\n'
|
||||||
if (envAwsAccessKey != null) {
|
if (envPrelertAwsAccessKey != null) {
|
||||||
print 'using access key from System.env.AWS_ACCESS_KEY_ID: ' + envAwsAccessKey + '\n'
|
print 'using access key from System.env.PRELERT_AWS_ACCESS_KEY_ID: ' + envPrelertAwsAccessKey + '\n'
|
||||||
project.ext.awsAccessKey = envAwsAccessKey
|
project.ext.prelertAwsAccessKey = envPrelertAwsAccessKey
|
||||||
} else if (project.hasProperty("AWS_ACCESS_KEY_ID")) {
|
} else if (project.hasProperty("PRELERT_AWS_ACCESS_KEY_ID")) {
|
||||||
print 'using access key from gradle.properties: ' + AWS_ACCESS_KEY_ID + '\n'
|
print 'using access key from gradle.properties: ' + PRELERT_AWS_ACCESS_KEY_ID + '\n'
|
||||||
project.ext.awsAccessKey = AWS_ACCESS_KEY_ID
|
project.ext.prelertAwsAccessKey = PRELERT_AWS_ACCESS_KEY_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
String envAwsSecretKey = System.env.AWS_SECRET_ACCESS_KEY
|
String envPrelertAwsSecretKey = System.env.PRELERT_AWS_SECRET_ACCESS_KEY
|
||||||
print 'BUILD - System.env.AWS_SECRET_ACCESS_KEY: ' + envAwsSecretKey + '\n'
|
print 'BUILD - System.env.PRELERT_AWS_SECRET_ACCESS_KEY: ' + envPrelertAwsSecretKey + '\n'
|
||||||
if (envAwsSecretKey != null) {
|
if (envPrelertAwsSecretKey != null) {
|
||||||
print 'using access key from System.env.AWS_SECRET_ACCESS_KEY: ' + envAwsSecretKey + '\n'
|
print 'using access key from System.env.PRELERT_AWS_SECRET_ACCESS_KEY: ' + envPrelertAwsSecretKey + '\n'
|
||||||
project.ext.awsSecretKey = envAwsSecretKey
|
project.ext.prelertAwsSecretKey = envPrelertAwsSecretKey
|
||||||
} else if (project.hasProperty("AWS_SECRET_ACCESS_KEY")) {
|
} else if (project.hasProperty("PRELERT_AWS_SECRET_ACCESS_KEY")) {
|
||||||
print 'using secret key from gradle.properties: ' + AWS_SECRET_ACCESS_KEY + '\n'
|
print 'using secret key from gradle.properties: ' + PRELERT_AWS_SECRET_ACCESS_KEY + '\n'
|
||||||
project.ext.awsSecretKey = AWS_SECRET_ACCESS_KEY
|
project.ext.prelertAwsSecretKey = PRELERT_AWS_SECRET_ACCESS_KEY
|
||||||
}
|
}
|
||||||
|
|
||||||
project.ext.isWindows = OperatingSystem.current().isWindows()
|
project.ext.isWindows = OperatingSystem.current().isWindows()
|
||||||
|
|
|
@ -51,9 +51,9 @@ class DownloadS3Task extends DefaultTask {
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void downloadFromS3() {
|
public void downloadFromS3() {
|
||||||
print 'DownloadS3Task - AWS ACCESS KEY ID: ' + project.awsAccessKey + '\n'
|
print 'DownloadS3Task - AWS ACCESS KEY ID: ' + project.prelertAwsAccessKey + '\n'
|
||||||
print 'DownloadS3Task - AWS SECRET ACCESS KEY: ' + project.awsSecretKey + '\n'
|
print 'DownloadS3Task - AWS SECRET ACCESS KEY: ' + project.prelertAwsSecretKey + '\n'
|
||||||
AWSCredentials creds = new BasicAWSCredentials(project.awsAccessKey, project.awsSecretKey)
|
AWSCredentials creds = new BasicAWSCredentials(project.prelertAwsAccessKey, project.prelertAwsSecretKey)
|
||||||
|
|
||||||
ClientConfiguration clientConfiguration = new ClientConfiguration();
|
ClientConfiguration clientConfiguration = new ClientConfiguration();
|
||||||
// the response metadata cache is only there for diagnostics purposes,
|
// the response metadata cache is only there for diagnostics purposes,
|
||||||
|
|
Loading…
Reference in New Issue