将github存储库与Google云存储分区同步 [英] Sync github repository with google cloud storage bucket

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

问题描述

是否可以将GitHub存储库与Google云存储存储桶同步,以便我可以在GitHub上编辑存储库,并自动使用更改更新存储桶。我已经尝试过谷歌云平台的源代码工具,但是我找不到任何方式根据源代码更新我的存储桶。

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 repo克隆到本地文件系统,然后设置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存储库与Google云存储分区同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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