gpt4 book ai didi

google-cloud-platform - 使用 Bitbucket 管道部署 GCloud App

转载 作者:行者123 更新时间:2023-12-05 07:37:20 25 4
gpt4 key购买 nike

我想在生产 环境中使用 bitbucket 管道部署我的应用程序。

我按照 https://cloud.google.com/solutions/continuous-delivery-bitbucket-app-engine 中给出的说明进行操作,但这是在暂存 环境。

我的流水线文件是

image: python:2.7

pipelines:
branches:
master:
- step:
script: # Modify the commands below to build your repository.
# Downloading the Google Cloud SDK
- curl -o /tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-155.0.0-linux-x86_64.tar.gz
- tar -xvf /tmp/google-cloud-sdk.tar.gz -C /tmp/
- /tmp/google-cloud-sdk/install.sh -q
- source /tmp/google-cloud-sdk/path.bash.inc
# Authenticating with the service account key file
- echo ${GOOGLE_CLIENT_SECRET} > client-secret.json
- gcloud auth activate-service-account --key-file client-secret.json
# Linking to the Google Cloud project
- gcloud config set project $CLOUDSDK_CORE_PROJECT
- gcloud -q app deploy app.yaml

这是向我显示以下错误

You are about to deploy the following services:
- my-app/default/232326565655 (from [/opt/atlassian/pipelines/agent/build/app.yaml])
Deploying to URL: [https://my-app.appspot.com]
Beginning deployment of service [default]...
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[/root/.config/gcloud/logs/2018.02.05/05.25.49.374053.log].
ERROR: gcloud crashed (UploadError): Error uploading files: HttpError accessing <https://www.googleapis.com/storage/v1/b/staging.my-app.appspot.com/o?alt=json&maxResults=1000>: response: <{'status': '403', 'content-length': '410', 'expires': 'Mon, 05 Feb 2018 05:25:52 GMT', 'vary': 'Origin, X-Origin', 'server': 'UploadServer', 'x-guploader-uploadid': 'UPLOADER_ID', 'cache-control': 'private, max-age=0', 'date': 'Mon, 05 Feb 2018 05:25:52 GMT', 'alt-svc': 'hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"', 'content-type': 'application/json; charset=UTF-8'}>, content <{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "bitbucket-authorization@my-app.iam.gserviceaccount.com does not have storage.objects.list access to staging.my-app.appspot.com."
}
],
"code": 403,
"message": "bitbucket-authorization@my-app.iam.gserviceaccount.com does not have storage.objects.list access to staging.my-app.appspot.com."
}
}

最佳答案

同样关注tutorial并且根据您提供的错误,您使用的服务帐户“”bitbucket-authorization@my-app.iam.gserviceaccount.com”没有访问临时存储桶的权限。

确保 App Engine > App Engine Admin & Storage > Storage Object Admin 角色已从 Cloud Console 授予此服务帐户.

在该教程中使用新项目时我注意到的最后一件事是我必须手动启用 Google App Engine Admin API也是。

编辑:您可以使用标志 --bucket=gs://BUCKETNAME在 bitbucket 用于部署的脚本中:

即 -> gcloud app deploy --bucket="gs://BUCKETNAME"

关于google-cloud-platform - 使用 Bitbucket 管道部署 GCloud App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48616749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com