Continuous Deployment using Git

Continuous Deployment is the natural progression of Continuous Integration. This site (a4word.com) provides a simple example whereby after each commit to the database, a suite of tests are run, the application is converted to static html (but maintain the .php extension so internal links work as expected), and the result is deployed to S3.

The script CD portion of the script, simply 'updates' the git repository on the remote server

  #!/bin/bash
  echo "---- About to update a4word.com"
  ssh deployer@a4word.com 'cd /home/deployer/www/portfolio; git checkout .; git pull --rebase'
  echo "---- Done."
  

On each push, the message would look similar to:

  $ git push
  Counting objects: 42, done.
  Delta compression using up to 3 threads.
  Compressing objects: 100% (25/25), done.
  Writing objects: 100% (29/29), 1404.77 KiB, done.
  Total 26 (delta 9), reused 0 (delta 0)
  remote: ---- About to update a4word.com
  remote: From localhost:~/gits/portfolio
  remote:    5e89eb0..dd4c329  master     -> origin/master
  remote: First, rewinding head to replay your work on top of it...
  remote: Fast-forwarded master to de4b428e5ee148ad77e502388b1ca09e4df73602.
  remote: ---- Done.