Introduction to automated WordPress deployments

Introduction to automated WordPress deployments

These are the slides from a talk given at WordCamp Miami 2017.

Do you dread deploying new WordPress code for clients? *raises hand* It’s weird to feel that way. Deploying WordPress code isn’t rocket science after all (or maybe it is and no one told me!).

It tends to come down to opening our favorite FTP client and pressing the upload button. Easy-peasy, right? Of course, not! (Things are never that easy…) You’re also refreshing the web page in the browser while praying that you don’t get a white screen of death.

It doesn’t have to be that way. You can deploy your WordPress code with confidence! It just comes down to creating the proper workflows and the right automation.

This is what you’ll learn in this talk. We’ll go over what makes a successful deployment workflow. You’ll also get an overview of the tools that you can use to automate deployments. It’s everything that you need to get started on your quest for safer WordPress deployments!

You can read the companion article at: https://carlalexander.ca/introduction-automated-wordpress-deployment

5a4758faa5ba6c1322bdfb0f6ebcf56c?s=128

Carl Alexander

March 25, 2017
Tweet

Transcript

  1. Introduction to automated WordPress deployments

  2. Carl Alexander

  3. @twigpress

  4. carlalexander.ca

  5. None
  6. Let’s play a game

  7. What do you do when you have to update a

    WordPress site? Let’s play a game…
  8. Press the upload button Let’s play a game…

  9. Mash the refresh button Let’s play a game…

  10. Sigh when everything loads! Let’s play a game…

  11. Pretty stressful way to work Let’s play a game…

  12. You should be able to deploy code as often as

    you want Let’s play a game…
  13. That’s where automated WordPress deployment comes in Let’s play a

    game…
  14. Makes updating WordPress safer Let’s play a game… (But not

    bulletproof!)
  15. Focus on shipping bug fixes and new features Let’s play

    a game…
  16. What is it?

  17. Part of a larger set of practices called DevOps What

    is it?
  18. Moves code between deployment environments What is it?

  19. For us, that’s moving our code from our computer to

    a server What is it?
  20. Been doing this from day 1 What is it? (Just

    by hand)
  21. What is it?

  22. Workflow

  23. Tools are important Workflow

  24. But so is your workflow Workflow

  25. Just a set of good habits Workflow

  26. Version control system

  27. Lots of tools require it Version control system

  28. Has a lot of other benefits Version control system

  29. History of all your code changes Version control system

  30. Version control system

  31. Also stores your code Version control system

  32. Version control system • Bitbucket • GitHub • GitLab

  33. Necessary for some automated deployment systems Version control system

  34. Better collaboration too Version control system

  35. No need to share your files Version control system

  36. Lets anyone deploy code Version control system

  37. Scary, but removes gatekeepers Version control system

  38. Testing

  39. Common to have testing with automated deployment Testing

  40. Unit tests, traditional QA or both Testing

  41. Derisks your workflow Testing

  42. Helps you deploy code more often Testing

  43. Reminder: this isn’t bulletproof Testing

  44. Automated deployment prevents error deploying code Testing

  45. But not deploying bad code Testing

  46. Multiple environments

  47. Testing and staging environments Environments

  48. Testing is for… testing Environments

  49. Staging mirrors production Environments

  50. Lets clients preview changes Environments

  51. Also to test high-risk operations Environments

  52. Requires almost no extra effort Environments

  53. Run into fewer problems Environments

  54. Questions

  55. Implemention

  56. Hosts

  57. Easiest option Hosts

  58. Also costliest Hosts

  59. How does it work?

  60. How does it work?

  61. Push to host repository How does it work?

  62. Deploys your code to server How does it work?

  63. Available hosts

  64. Can be narrow or broad category Available hosts

  65. Lots of hosts offer git support Available hosts

  66. Most aren’t set up by default Available hosts

  67. Only covering the ones that have it set up for

    you Available hosts
  68. Leaves us with two hosts Available hosts

  69. Pantheon and WP Engine Available hosts

  70. Services

  71. Cheaper alternative Services

  72. Flexibility to chose your host Services

  73. How does it work?

  74. How does it work?

  75. Service like GitHub mandatory How does it work?

  76. Push to GitHub repository How does it work?

  77. Allows for complex deployments How does it work?

  78. Available services

  79. Lots of services out there Available services

  80. Only focus on two Available services

  81. DeployBot and DeployHQ Available services

  82. Plugins

  83. Final option Plugins

  84. Different from what we’ve seen Plugins

  85. Can’t deploy a WordPress site Plugins

  86. Only plugins and themes Plugins

  87. How does it work?

  88. How does it work?

  89. Connects plugins and themes How does it work?

  90. Let’s you install or update by hand How does it

    work?
  91. Webhook required for automation How does it work?

  92. How does it work?

  93. Plugin is blind without webhook How does it work?

  94. Available plugins

  95. GitHub updater and WP Pusher Available plugins

  96. Both plugins are almost identical Available plugins

  97. The big difference is the price Available plugins

  98. Questions

  99. Do it yourself

  100. More complicated to do Do it yourself

  101. But also free Do it yourself

  102. Remote repository

  103. Works like hosts seen earlier Remote repository

  104. Push code to repository to deploy Remote repository

  105. Offered by some WordPress hosts Remote repository

  106. Webhook

  107. Similar to the services from earlier Webhook

  108. Install custom webhook endpoint Webhook

  109. Push code to GitHub Webhook

  110. Also supported by some hosts Webhook

  111. Deployment tools

  112. Almost every language has a tool Deployment tools

  113. Deployment tools

  114. Your computer does all the work Deployment tools

  115. Also requires server configuration Deployment tools

  116. Not possible with regular hosts Deployment tools

  117. Two server configuration projects support this kind of deployment Deployment

    tools
  118. DebOps and Trellis Deployment tools

  119. Taking the stress out

  120. Lots of options available to you! No stress

  121. Most aren't that complicated No stress

  122. Never fear deploying code again No stress

  123. Questions

  124. Thank you!