更新时间:2023-12-03 09:54:40
您需要将您的服务帐户JSON文件作为秘密文件上传. 然后:
You need to upload your Sevice Account JSON file as a secret file. Then:
withCredentials([file(credentialsId: 'key-sa', variable: 'GC_KEY')]) {
sh("gcloud auth activate-service-account --key-file=${GC_KEY}")
sh("gcloud container clusters get-credentials prod --zone northamerica-northeast1-a --project ${project}")
}