我正在尝试为我们基于 HTML 的网站在 bitrise 上添加一个新应用程序。我试图在 bitrise 上添加一个新应用程序,但我不知道如何将新应用程序设置为谷歌存储上的静态网站。将代码推送到 bitbucket 存储库时,有没有办法在 bitrise 上设置触发器以将文件和目录上传到谷歌云存储桶?谢谢!
问问题
294 次
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
基本工作流程如下所示:
- SSH Auth 和 Git Clone 步骤,下载代码
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 )- 然后是一个
Script
步骤,您可以在其中激活/验证服务帐户文件 ( https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account ),然后您可以使用gcloud
/gsutil
任何您喜欢的方式。
于 2019-04-03T14:05:52.253 回答