我正在尝试使用gcloud设置jenkins管道,但我得到了以下错误:
gcloud auth激活-service-帐户-键- file ./service-account- create s.json警告:无法在/..config/gcloud/ log中设置日志文件(错误:未能创建目录/..config/gcloud/log/2019.02.07:权限被拒绝)。
守则:
stages {
stage('build') {
steps {
withCredentials([file(credentialsId: 'google-container-registry', variable: 'GOOGLE_AUTH')]) {
script {
docker.image('google/cloud-sdk:latest').inside {
sh "echo ${GOOGLE_AUTH} > gcp-key.json"
sh 'gcloud auth activate-service-account --key-file ./service-account-creds.json'
}
}
}
}
}
}Jenkins使用imagen jenkins/jenkins在一个容器中运行
发布于 2019-02-07 18:57:33
试试这个:
withCredentials([file(credentialsId: 'google-container-registry', variable: 'GOOGLE_AUTH')]) {
script {
docker.image('google/cloud-sdk:latest').inside {
sh "echo ${GOOGLE_AUTH} > gcp-key.json"
sh "gcloud auth activate-service-account --key-file=${GOOGLE_AUTH}"
}
}
}https://stackoverflow.com/questions/54579766
复制相似问题