cloud-run-button icon indicating copy to clipboard operation
cloud-run-button copied to clipboard

Fork repo and set up Continuous Deployment instead of one-shot deployment

Open steren opened this issue 5 years ago • 3 comments
trafficstars

The experience of the button is amazing: click, get something running.

But that's how you should deploy software. That's great for demos or for one-shot images that don't have to be updated, but not great for iterating on a codebase. Consequently, this limits the use cases for the button (we should not use the button for "boilerplate"-type repositories)

A more sustainable way for customers to go from GitHub to Cloud Run would be:

  1. Fork the repo.
  2. set up a Cloud Build Trigger to automatically deploy from the fork to Cloud Run
  3. Run this trigger.

Maybe the button could help do that?

This would address along the way:

  • https://github.com/GoogleCloudPlatform/cloud-run-button/issues/155
  • https://github.com/GoogleCloudPlatform/cloud-run-button/issues/103

steren avatar Jul 14 '20 20:07 steren

Yeah, that is what I've been thinking about related to #75

jamesward avatar Jul 14 '20 21:07 jamesward

I'll play the devils advocate yet again.

  • Setting up GCB is harder than you think if not impossible. Right now you can't just set up GitHub <=> GCB integration via the API. I filed a feature request for it several years ago, but there's no plan to do it.

  • We have been keeping "redeploy" use case nearly always in mind. I have repos myself (e.g. https://github.com/ahmetb/serverless-url-redirect or https://github.com/ahmetb/sheets-url-shortener) that people can fork+redeploy using the button multiple times.

    So it still works without setting up a trigger. Just requires a user interaction. We also show the user how to also re-deploy with the CLI command.

If you think it's possible, go for it.

As I mentioned above and in this comment, interacting with GCB is not easy today.

ahmetb avatar Jul 14 '20 22:07 ahmetb

2 cents:

  • Cloud Run Button is great for the optional initial provisioning and first deployment
  • gcloud builds submit --tag/gcloud run deploy is okay for a two-step re-deployment
  • gcloud builds submit with a configured cloudbuild.yaml is great for re-deployment
  • Firing that GCB call through a trigger is good for continuous deployment

It'd be neat if the button could show a cloudbuild.yaml re-deployment equiv example. If that's just a basic generic file, or if it's generated from the app.json, either way.

The authentication required to link GH and GCB limits the flow of the automation of the full CD process.

glasnt avatar Jul 15 '20 04:07 glasnt