Fast Aegir deployment

Categories:

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

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <abbr> <acronym> <h3> <span> <img> <q> <blockquote> <div> <pre>
  • Lines and paragraphs break automatically.

More information about formatting options