我正在尝试使用特定用户解析文件~/.aws/credentials
,以便可以将选定的user credentials
传递给aws凭证。我已经为这项工作创建了这个非常简单的脚本:
// there is a function `getProfile` defined before this and return map value
ext.profileAWSAccess = getProfile("gujarat")['accessKey']
ext.profileAWSSecret = getProfile("gujarat")['secretKey']
println(getProfile("gujarat"))
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "${internal_s3_url1}"
credentials(AwsCredentials) {
accessKey profileAWSAccess
secretKey profileAWSSecret
}
}
}
}
这些是我尝试过的事情:
"${profielAWSAccess}"
"profileAWSAccess"
profileAWSAccess
代替ext.profileAWSAccess
以上都没有工作,我收到了这个错误:
* What went wrong:
A problem occurred evaluating root project 'bootcamp'.
> Could not get unknown property 'profileAWSAccess' for object of type org.gradle.internal.credentials.DefaultAwsCr
edentials_Decorated.
我哪里出错了?
为什么我的profileAWSAccess
类型为ype org.gradle.internal.credentials.DefaultAwsCr
edentials_Decorated
?
任何帮助将不胜感激。