【发布时间】:2020-03-24 20:34:40
【问题描述】:
Bitbucket 不会使用 Google 云服务密钥读取我的 base64 编码 json 文件。
我已经成功编码然后自己解码了 Bitbucket 尝试解码的同一个文件。
但是 Bitbucket 无法做到这一点,并出现 base64: invalid input 错误。
以下是完整的错误信息:
Status: Downloaded newer image for bitbucketpipelines/google-app-engine-deploy:0.6.1
INFO: Setting up environment.
echo "${KEY_FILE}" | base64 -d >> /tmp/key-file.json
base64: invalid input
gcloud auth activate-service-account --key-file /tmp/key-file.json --quiet --verbosity=warning
ERROR: (gcloud.auth.activate-service-account) Could not read json file /tmp/key-file.json: Unterminated string starting at: line 3 column 17 (char 49)
gcloud config set project wowzers --quiet --verbosity=warning
Updated property [core/project].
INFO: Starting deployment to GCP app engine...
gcloud app --quiet deploy app.yaml --version=14 --promote --stop-previous-version --verbosity=debug --quiet --verbosity=warning
ERROR: (gcloud.app.deploy) You do not currently have an active account selected.
据我了解,它在 "project_id": " 上失败了。
解码后的文件如下所示:
{
"type": "service_account",
"project_id": "project-318",
"private_key_id": "...",
...
}
我尝试先通过环境变量然后通过文件提供我的 base64 编码密钥文件。但同样的错误。当它无法提取 JSON bitbucket 时会写入此错误:
ERROR: (gcloud.auth.activate-service-account) Could not read json file /tmp/key-file.json: No JSON object could be decoded
【问题讨论】:
标签: google-app-engine bitbucket-pipelines