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.
Thanks
Open a github repository in the Cloud Shell The trick here is to just call the following URL: https://console.cloud.google.com/cloudshell/open with the following parameters: git_repo : this is the URL to your github repository. open_in_editor : this would be the file you want to open in the editor.
In the Google Cloud console, go to the Cloud Storage Buckets page. Navigate to the bucket. Click on Create folder to create an empty new folder, or Upload folder to upload an existing folder.
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
You can use git annex with GCS. The last time I tried it was 2013, but it worked flawlessly then. You can see my example of how to use Google Cloud Storage with git-annex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With