Moving to GCP

Reasoning

I'll be pretty upfront that I'm trying to do this website on the cheap. It's entirely a personal hobby and about learning rather than selling anything or generating income through advertising (or similar). With that in mind, when my free trial was up on AWS, it wasn't hard to justify jumping to the next free trial. Also, while GCP is not a member of Cloudflare's bandwidth alliance, they do have a CDN Interconnect program and appear more open than AWS to possible joint ventures that could help me in the future (since I'm already using Cloudflare's CDN). Last, it gives me an excuse to play with yet another large cloud provider.

Initial Move

My initial move came during a time when I was travelling a bit, so I didn't have as much free time as I would have liked. While I worked through the GitLab CI, I took a shortcut and pushed the complete site to a GCP bucket.

Dealing with Redirects

AWS had a very easy system for pointing one bucket to another (for what amounts to a redirect), but I couldn't find similar functionality in GCP's storage (although I might have missed it). I ended up placing a very simple page at www.colton.space with a javascript-based redirect to colton.space.

Working with CI

With AWS, I was using the cp function to restrict operations to only what was needed (based on a git diff between the master branch and a version.json file hosted on the site. As I moved to GCP, I swapped to gsutil rsync which simplified my CI statements substantially.

One slight complaint, GCP only seems to have short-form options or single-character arguments to the functions. It makes for code that's slightly harder to read and isn't quite as pretty. I ended up putting a few comment lines at the end of my CI script to remind me what the options do in the future e.g. # -n dry run. It's inelegant, and I wish I could just put in an arg like --dry-run directly.

Verifying Ownership of the Domain

One interesting difference between the two providers is that GCP asked me to verify that I control the domain by adding a specific DNS entry. It was easy enough to do, and afterward GCP allowed me to point the buckets appropriately and make them public.

Conclusions

Once I understood a bit how GCP worked, I was able to get the CI working pretty well, and I'm quite happy with how using the rsync function simplified my CI script. I'll probably stick with GCP even after my free trial ends. We'll see if I post again about cloud providers in a year!