将 github 存储库与谷歌云存储桶同步 [英] Sync github repository with google cloud storage bucket

查看:26
本文介绍了将 github 存储库与谷歌云存储桶同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将 GitHub 存储库与谷歌云存储桶同步,以便我可以在 GitHub 上编辑存储库,它会根据更改自动更新存储桶.我已经尝试过google云平台源码工具,但是我找不到任何方法来根据源码更新我的bucket.

Is it possible to sync a GitHub repository with a google cloud storage bucket, so that I can edit the repository on GitHub and it automatically updates the bucket with the changes. I have already tried the google cloud platform source code tools, but I couldn't find any way to update my bucket based on the source code.

谢谢

推荐答案

在 git repo 和 GCS 之间没有直接的同步方式.但是,如果您可以容忍在更新 GitHub 和更改出现在您的存储桶之间存在一些延迟,您可以创建一个 Google Compute Engine 实例并将您的 git 存储库克隆到那里的本地文件系统,然后设置一个 cron 作业在该实例上定期从您的 GitHub 存储库执行 git pull,然后运行 ​​gsutil rsync 以从那里更新您的 GCS 存储桶.确保从 rsync 命令中排除 .git 文件,例如通过运行如下命令:

There's no direct way to synchronize between a git repo and GCS. However, if you can tolerate some delay between when you update GitHub and when the changes show up in your bucket, you could create a Google Compute Engine instance and clone your git repo to the local file system there, and then set up a cron job on that instance that periodically does a git pull from your GitHub repo and then runs gsutil rsync to update your GCS bucket from there. Make sure to exclude the .git files from the rsync command, for example by running a command like:

gsutil rsync -rd -x .git . gs://your-bucket

这篇关于将 github 存储库与谷歌云存储桶同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆