I have a post-receive hook set up on a remote machine which checks out a working copy of a website, installs latest dependencies, rebuilds some assets, and then restarts the HTTP daemon. So I can push code from my laptop to deploy the latest version of a site.
However, the hook can take a while to run. What will happen if I Ctrl-C the git push on my laptop after the changes have been received but before the hook finishes running? Will the hook script get interrupted remotely, too?
What will happen if I Ctrl-C the git push on my laptop after the changes have been received but before the hook finishes running?
Nothing special. The hook's output to your end gets lost, so you can't see if it worked or not. The hook itself still runs to completion, and if you write a sensible hook, it's already logging its results somewhere, as there's no guarantee that a person is watching the result now and will know what to do if it fails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With