【发布时间】:2020-09-21 22:19:06
【问题描述】:
我的要求是从 docker 构建镜像并将镜像推送到 GCR(Google 容器注册表)。 所以我在 Jenkins 中安装了必要的插件。另外,我为此编写了 jenkinsfile。
withCredentials([file(credentialsId: 'saProject', variable: 'GC_KEY')]){
sh "gcloud auth activate-service-account --key-file='$GC_KEY'"
}
我正在尝试像这样访问 GCP,但出现以下错误。
ERROR: Credentials 'saProject' is of type 'Google Service Account from private key' where'org.jenkinsci.plugins.plaincredentials.FileCredentials' was expected
Finished: FAILURE
我找不到问题所在。谁能帮忙解决这个问题?
提前致谢
【问题讨论】: