Reputation: 1068
I am looking into Cloud Run to host my new app, and I am wondering if it is possible to generate a separate URL for each git branch. I use Netlify to host my other app. When it is connected to GitHub (or other VCS services), it builds the source code in a branch and deploy it to a URL that is specific to the branch. Can it be done easily or do I have to write some logic?
Or do you think AWS amplify or some other services are of better fit?
Upvotes: 1
Views: 904
Reputation: 45282
This answer won't be directly useful to you but I think it's relevant and worth mentioning
The open source Knative API (and implementation actually exposes a "tag" feature while splitting the traffic between multiple revisions: https://github.com/knative/docs/blob/master/docs/serving/spec/knative-api-specification-1.0.md#traffictarget
This feature is not currently supported on Cloud Run fully managed, but it will be.
By tagging releases this way, you could define tag: v1
and tag: v2
in your traffic configuration, and you would get new URLs like:
that directly go to these specific versions.
And the interesting thing is, these revisions you specified in the traffic:
block of the Service object do not have to receive any traffic (you can say traffic percentage: 0
) but it would still create a domain name like I showed above to the inactive revisions of your app.
So when Cloud Run fully-managed supports tag
fields, you can actually achieve this, although it will be less out-of-the-box experience than Netlify.
Upvotes: 1
Reputation: 75940
The concept of Cloud Run and URLs is quite simple:
https://<service-name>-<project hash>.<region>.run.app
If your project and region are the same for all the branches, you simply have to deploy a different service for each branch to get a different URL.
That was for Cloud Run. Now, I'm not sure that Netlify is compliant with Cloud Run. I found no documentation on this.
Upvotes: 5