2

Is possible to access or copy (transfer) a git Google Cloud Source repository to Google Cloud Storage.

The idea is to use the git repo as a website like GitHub Pages.

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
lascarayf
  • 3,423
  • 3
  • 19
  • 24

1 Answers1

3

You can do this as follows:

  1. clone the Google Cloud Source repo
  2. use gsutil cp -r dir1/dir2 gs://my_bucket/subdir to copy the contents of the data to Google Cloud Storage, possibly after processing (e.g., if you want to use something like Jekyll or Middleman to generate your website). Note that this will also copy your .git directory as well, which you might want to exclude.
Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
  • Misha, I want to be automatically reflected (no two steps). Thanks !! – lascarayf Aug 03 '15 at 03:06
  • @lascarayf — I'm not sure how to do this in a single step and don't think it's possible. Note that even on GitHub Pages, you have to (a) check out your GitHub repo locally, (b) modify it, (c) commit it, and (d) publish your site by pushing to the `gh-pages` branch on GitHub. There isn't a "single-step" publishing for Git that I'm aware of. – Misha Brukman Aug 03 '15 at 04:08
  • No, in github the page is a git repo, i can commit a change to a html file and then do a push and the page change is automaticaly reflected. – lascarayf Aug 03 '15 at 07:09
  • @lascarayf — I don't think there are server-side triggers to do what you're looking for here; you may consider using [`gsutil rsync`](https://cloud.google.com/storage/docs/gsutil/commands/rsync) together with [git commit hooks](https://githooks.com/) to accomplish this. – Misha Brukman Mar 18 '18 at 22:02