rsync -Pa ./site/ [email protected]:/home/deploy/web/site/
Note: The trailing slashes are important.
I use nodemon to watch /home/deploy/web/site/ for changes, which restarts the server. There are tools like nodemon for whatever stack you're using (rails, etc).
However, if you're feeling brave, you should definitely check out OpenShift (community version at http://openshift.org). OpenShift is basically Kubernetes with a bunch of cool stuff added, one especially useful feature is source-to-image.
It pulls your code from a scm repo and finds a builder image (or you can choose one) and it will build the docker image for you. You can have it pull whenever there is new code and rebuild the image and deploy if you want.
On top of that you get lots of cool docker orchestration features.
if you are looking for a product who's primary goal is to create identical machine images check out Packer https://www.packer.io/intro
I want to somehow set up an identical environment on my dev machine, and on a VPS in another continent (too much latency to edit files on directly). Ideally I'd then be able to deploy from a dev environment identical to my production environment. I tried docker but debugging the containers did my head in. I was thinking of trying VM images with vagrant, but I'd love to know if there is a simpler solution to this.
I'm just one person doing it in their spare time.