0

我正在尝试为我们基于 HTML 的网站在 bitrise 上添加一个新应用程序。我试图在 bitrise 上添加一个新应用程序,但我不知道如何将新应用程序设置为谷歌存储上的静态网站。将代码推送到 bitbucket 存储库时,有没有办法在 bitrise 上设置触发器以将文件和目录上传到谷歌云存储桶?谢谢!

4

1 回答 1

0

您应该可以通过脚本执行此操作,例如使用预装在 Linux 堆栈https://cloud.google.com/sdk/gcloud/上的 Google Cloud CLI

https://cloud.google.com/storage/docs/uploading-objects包括例如gsutil示例。

使用服务帐户进行身份验证:https ://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account 注意:您可以使用 Bitrise 通用文件存储来存储服务帐户 json 密钥文件:https: //devcenter.bitrise.io/tutorials/how-to-use-the-generic-file-storage/#uploading-files-to-generic-file-storage-on-bitriseio

基本工作流程如下所示:

  1. SSH Auth 和 Git Clone 步骤,下载代码
  2. File Downloader下载服务帐户 JSON 文件的步骤(上传到通用文件存储的文件:https ://devcenter.bitrise.io/tutorials/how-to-use-the-generic-file-storage/#uploading-files- to-generic-file-storage-on-bitriseio )。或者,如果您想以加密形式存储它,您可以使用Decrypt file指南中提到的步骤(https://devcenter.bitrise.io/tutorials/how-to-use-the-generic-file-storage/# using-the-files-uploaded-to-generic-file-storage-on-bitriseio )
  3. 然后是一个Script步骤,您可以在其中激活/验证服务帐户文件 ( https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account ),然后您可以使用gcloud/gsutil任何您喜欢的方式。
于 2019-04-03T14:05:52.253 回答