"value":"\n <p>The last few days' emails have been about using Ansible to create and configure infrastructure, but it can also be used to deploy application code.<\/p>\n\n<p>The simplest way being that an artifact is built locally - e.g. a directory of static HTML pages from a static site generator - and uploaded onto the server, and for this you could use Ansible's <code>synchronize<\/code> module.<\/p>\n\n<p>It's a wrapper around the <code>rsync<\/code> command and makes it as simple as specifying <code>src<\/code> and <code>dest<\/code> values for the local and remote paths.<\/p>\n\n<p>For more complicated deployments, I like to use a tool called Ansistrano - an Ansible port of a deployment tool called Capistrano.<\/p>\n\n<p>It creates a new directory for each release and updates a <code>current<\/code> symlink to identify and serve the current release, and can share files and directories between releases.<\/p>\n\n<p>As well as being able to configure settings such as the deployment strategy, how many old releases to keep, and even the directory and symlink names, there are a number of hooks that you can listen for an add your own steps as playbooks so you can install dependencies, generate assets, run migrations, or rebuild a cache as part of each deployment.<\/p>\n\n<p>If you're running your applications in Docker, you could use Ansible to pull the latest images and restart your applications.<\/p>\n\n<p>For more information and examples, I've given a talk on Ansible at various PHP events, which covers some Ansible basics before moving on to <a href=\"/talks\/deploying-php-ansible-ansistrano\">deploying applications with Ansistrano<\/a>.<\/p>\n\n<hr \/>\n\n<p>Want to learn more about how I use Ansible? <a href=\"/ansible-course\">Register for my upcoming free email course<\/a>.<\/p>\n\n ",
"processed":"\n <p>The last few days' emails have been about using Ansible to create and configure infrastructure, but it can also be used to deploy application code.<\/p>\n\n<p>The simplest way being that an artifact is built locally - e.g. a directory of static HTML pages from a static site generator - and uploaded onto the server, and for this you could use Ansible's <code>synchronize<\/code> module.<\/p>\n\n<p>It's a wrapper around the <code>rsync<\/code> command and makes it as simple as specifying <code>src<\/code> and <code>dest<\/code> values for the local and remote paths.<\/p>\n\n<p>For more complicated deployments, I like to use a tool called Ansistrano - an Ansible port of a deployment tool called Capistrano.<\/p>\n\n<p>It creates a new directory for each release and updates a <code>current<\/code> symlink to identify and serve the current release, and can share files and directories between releases.<\/p>\n\n<p>As well as being able to configure settings such as the deployment strategy, how many old releases to keep, and even the directory and symlink names, there are a number of hooks that you can listen for an add your own steps as playbooks so you can install dependencies, generate assets, run migrations, or rebuild a cache as part of each deployment.<\/p>\n\n<p>If you're running your applications in Docker, you could use Ansible to pull the latest images and restart your applications.<\/p>\n\n<p>For more information and examples, I've given a talk on Ansible at various PHP events, which covers some Ansible basics before moving on to <a href=\"/talks\/deploying-php-ansible-ansistrano\">deploying applications with Ansistrano<\/a>.<\/p>\n\n<hr>\n\n<p>Want to learn more about how I use Ansible? <a href=\"/ansible-course\">Register for my upcoming free email course<\/a>.<\/p>\n\n ",