【发布时间】:2018-01-03 10:22:24
【问题描述】:
我想在 Jenkins 管道中使用 gcloud,因此我必须首先使用 Google 服务帐户进行身份验证。我正在使用 https://wiki.jenkins.io/display/JENKINS/Google+OAuth+Plugin 来保存我的私钥凭据。我坚持将凭据加载到管道中:
withCredentials([[$class: 'MultiBinding', credentialsId: 'my-creds', variable: 'GCSKEY']]) {
sh "gcloud auth activate-service-account --key-file=${GCSKEY}"
}
我也从文件中尝试过,但没有运气。
withCredentials([file(credentialsId:'my-creds', variable: 'GCSKEY')]) {
日志说:
org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: Credentials 'my-creds' is of type 'Google Service Account from private key' ....
【问题讨论】:
标签: authentication jenkins jenkins-pipeline credentials gcloud