Fast Aegir deployment
I am doing multi-server Aegir work and deployments were taking 10 seconds to get code to the servers. I have a hostmaster server and a web-only server, both need provision. I edit code on my laptop with my usual shell and editor. Now pushing 3 codebases takes less than 1 second. Use SSH master connections by adding
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
to ~/.ssh/config. When another SSH connection is open, new connections piggyback on it, saving connection time and getting straight to the rsync.
#!/bin/bash
( rsync -azC hostmaster/ aegir@aegir-dev:hostmaster-HEAD/profiles/hostmaster; echo aegir-dev hostmaster ) &
( rsync -azC provision/ aegir@aegir-dev:.drush/provision; echo aegir-dev provision ) &
( rsync -azC provision/ aegir@web:.drush/provision; echo web provision ) &
wait
The -C skips .git files. The & backgrounds each task and wait waits, so all three are done in parallel.
Now I have my familiar shell and editor with localhost speed. No more jumping around servers and forgetting to update one of the provisions. And updating code is fast enough to not slow me down.
Post new comment