unit and acceptance testing, automation, productivity

Cloud 66 Postfix Deploy Hook

The Cloud 66 documentation to install SMTP on a server is excellent and easy to follow, but glosses over how to write a deploy hook to automate the process.

This is my take on a deploy hook to install SMPT through Postfix.


    - source: /.cloud66/
      destination: ~/
      target: any
      apply_during: build_only
      execute: true
      sudo: true


set -e

# Install Postfix to send emails
yet | sudo apt-get install postfix

# Configure Postfix
sudo echo "myhostname =" >> /etc/postfix/

# Apply configurations
sudo /etc/init.d/postfix reload

This is the first deploy hook that I've ever written for Cloud 66, so if you think there's a better way to achieve the result please get in touch through Twitter @mokagio, or leave a comment below.

Leave the codebase better than you found it.

Want more of these posts?

Subscribe to receive new posts in your inbox.