GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
525 stars 91 forks source link

Note that create hooks are skipped on existing services #189

Closed glasnt closed 3 years ago

glasnt commented 4 years ago

Without this change, pre/post create hooks are silently skipped.

The message as it is will not make sense if there aren't any create hooks are configured, but it's better than nothing.

jamesward commented 4 years ago

I think this will be confusing to users who don't know what the hooks are. Perhaps we only say something when there are hooks configured? Or we better convey when a service is being updated vs created?

ahmetb commented 4 years ago

If you need hooks for "update", I'm afraid the correct way to address this might be introduce new hooks (predeploy, postdeploy) that are called in both create/update. But we should probably update README.md to say create-hooks aren't going to be invoked on redeploys.

jamesward commented 4 years ago

The prebuild and postbuild hooks can be used for cases where hooks are needed on create & update.

jamesward commented 4 years ago

Oh, but maybe we don't have a way to do a postupdate hook. I haven't needed that myself, but maybe there is a use case?

glasnt commented 4 years ago

To solve my use case (remind me that I'm updating rather than creating), could I submit a different PR that at least adds an information note when existingService is not nil?

jamesward commented 4 years ago

Yeah, I think we either do something easy, like: The service blah exists and will be updated (before we do the gcloud run deploy) Or we get fancy and say: The service blah exists, update it? [Y|n] Then if they say n ask them for a new service name.