by pastage · 5y ago · 0 comments
1. Configure a service 2. Use start command sleep infinity 3. Install inotify_wait on windows 4. Do a loop like this
Look for changes, Rsync changes to pod, Pkill java, Run start.sh
We do a grep on changed files and only kill java if jar/classes and other deps has changed, that makes it possible to edit html in pod and get fast updates.
It’s essentially a vastly superior “vagrant up” on anabolic steroids
We recently re-wrote the hot reload functionality to use Mutagen[2] under the hood and it's insanely fast (<200ms anecdotally). It also does two way sync which can be useful. The old implementation used rsync but a lot of our Windows users struggled with that. So I figured I'd share in case that sounds familiar.
What happens after a sync event depends on the stack, but we've had pretty good success with Entr[3]. We often have it watch a single file so that multiple watchers in a shared dev cluster don't eat up all the node's resources.
1: https://github.com/garden-io/garden 2: https://mutagen.io/ 3: http://eradman.com/entrproject/