oliverdavies.uk/source/_presentations/deploying-php-ansible-ansistrano.md

3.8 KiB
Raw Permalink Blame History

title description speakerdeck video events
Deploying PHP applications with Ansible, Ansible Vault and Ansistrano How to use Ansible and Ansistrano to perform robust, secure deployments of your PHP applications.
id ratio url
c11fe635ed8f4741b35bf3ebe53e8323 1.77777777777778 https://speakerdeck.com/opdavies/deploying-php-applications-with-ansible-ansible-vault-and-ansistrano
type id
youtube dQL-gOnxXCM
name date location url
Drupal Bristol 2019-01-23 Bristol, UK https://www.drupalbristol.org.uk
name date location url
PHP South Wales 2019-07-23 Cardiff, UK https://www.phpsouthwales.uk
name date location url
DrupalCon Europe 2019 2019-10-30 Amsterdam, NL https://events.drupal.org/amsterdam2019
name date location url
Bristol Cloud Native & DevOps 2020-01-30 Bristol, UK https://www.meetup.com/Bristol-Cloud-Native-DevOps/events/266609627
name date location url online
Drupal Edinburgh 2020-03-12 Edinburgh, UK https://www.meetup.com/Drupal-Edinburgh/events/267905594 true
name date location url online
CMS Philly 2020-05-01 Philadelphia, USA https://cmsphilly.org true
name date location url online
Drupal Yorkshire 2020-05-21 Leeds, UK https://www.meetup.com/DrupalYorkshire/events/zwzsfpybchbcc true
name date location url online
PHP London 2020-06-04 London, UK https://www.meetup.com/phplondon/events/270930524 true
name date location url online
PHP North East 2020-06-16 Newcastle Upon Tyne, UK https://www.meetup.com/phpnortheast true
name date location url online
PHP Sussex 2020-07-01 Brighton, UK https://www.meetup.com/PHP-Sussex/events/271472628 true
name date url online
Midwest PHP 2021-04-23 https://midwestphp.org/talks/1q5XUF2tTdXXLYOoujMkpF/Deploying_PHP_applications_with_Ansible_Ansible_Vault_and_Ansistrano true
name date location url online
PHP Oxford 2021-04-28 Oxford, UK https://www.meetup.com/PHP-Oxford/events/qmbkfsyccgblc true
name date location url online
Ansible London 2021-05-25 London, UK https://www.meetup.com/Ansible-London/events/278093392 true
name date location url online
DrupalNYC 2021-06-15 New York, USA https://ti.to/drupalnyc/lunch-learn-2021-06-15 true

Great! Youve built your website, and now you just need to deploy it. There are various ways that this could be done - from (S)FTP, to SCP and rsync, to running commands like git pull and composer install directly on the server which is not ideal.

As well provisioning and maintaining your server configuration and running commands, you can also use Ansible to deploy your PHP application - leveraging relevant Ansible modules such as Git and Composer, custom Ansible roles, Ansible Vault for managing secrets, and features such as idempotency out of the box to build a simple deployment playbook. We can then extend that and make it more robust by adding Ansistrano - a port of Capistrano - which adds extra features such as storing multiple builds for each project and the ability to roll-back if needed, customising your build steps using built-in hooks, multi-stage environments and more.

I've been using Ansible and Ansistrano to deploy a variety of PHP projects - including Drupal 7 & 8, Symfony, Laravel and Sculpin, as well as basic HTML websites, and found it to be very flexible and easy to install and use, and by the end of this talk we will have a fully working deployment playbook, deploying real code onto a real server.