Closed glasnt closed 3 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?
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.
The prebuild
and postbuild
hooks can be used for cases where hooks are needed on create & update.
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?
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?
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.
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.