$30 off During Our Annual Pro Sale. View Details »

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

Carl Alexander

March 25, 2017
Tweet

More Decks by Carl Alexander

Other Decks in Technology

Transcript

  1. Introduction to automated
    WordPress deployments

    View Slide

  2. Carl Alexander

    View Slide

  3. @twigpress

    View Slide

  4. carlalexander.ca

    View Slide

  5. View Slide

  6. Let’s play a game

    View Slide

  7. What do you do when you have to
    update a WordPress site?
    Let’s play a game…

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  12. You should be able to deploy code
    as often as you want
    Let’s play a game…

    View Slide

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

    View Slide

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

    View Slide

  15. Focus on shipping
    bug fixes and new features
    Let’s play a game…

    View Slide

  16. What is it?

    View Slide

  17. Part of a larger set of practices
    called DevOps
    What is it?

    View Slide

  18. Moves code between
    deployment environments
    What is it?

    View Slide

  19. For us, that’s moving our code
    from our computer to a server
    What is it?

    View Slide

  20. Been doing this from day 1
    What is it?
    (Just by hand)

    View Slide

  21. What is it?

    View Slide

  22. Workflow

    View Slide

  23. Tools are important
    Workflow

    View Slide

  24. But so is your workflow
    Workflow

    View Slide

  25. Just a set of good habits
    Workflow

    View Slide

  26. Version control system

    View Slide

  27. Lots of tools require it
    Version control system

    View Slide

  28. Has a lot of other benefits
    Version control system

    View Slide

  29. History of all your code changes
    Version control system

    View Slide

  30. Version control system

    View Slide

  31. Also stores your code
    Version control system

    View Slide

  32. Version control system
    • Bitbucket
    • GitHub
    • GitLab

    View Slide

  33. Necessary for some
    automated deployment systems
    Version control system

    View Slide

  34. Better collaboration too
    Version control system

    View Slide

  35. No need to share your files
    Version control system

    View Slide

  36. Lets anyone deploy code
    Version control system

    View Slide

  37. Scary, but removes gatekeepers
    Version control system

    View Slide

  38. Testing

    View Slide

  39. Common to have testing with
    automated deployment
    Testing

    View Slide

  40. Unit tests, traditional QA or both
    Testing

    View Slide

  41. Derisks your workflow
    Testing

    View Slide

  42. Helps you deploy code more often
    Testing

    View Slide

  43. Reminder: this isn’t bulletproof
    Testing

    View Slide

  44. Automated deployment
    prevents error deploying code
    Testing

    View Slide

  45. But not deploying bad code
    Testing

    View Slide

  46. Multiple environments

    View Slide

  47. Testing and staging
    environments
    Environments

    View Slide

  48. Testing is for… testing
    Environments

    View Slide

  49. Staging mirrors production
    Environments

    View Slide

  50. Lets clients preview changes
    Environments

    View Slide

  51. Also to test high-risk operations
    Environments

    View Slide

  52. Requires almost no extra effort
    Environments

    View Slide

  53. Run into fewer problems
    Environments

    View Slide

  54. Questions

    View Slide

  55. Implemention

    View Slide

  56. Hosts

    View Slide

  57. Easiest option
    Hosts

    View Slide

  58. Also costliest
    Hosts

    View Slide

  59. How does it work?

    View Slide

  60. How does it work?

    View Slide

  61. Push to host repository
    How does it work?

    View Slide

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

    View Slide

  63. Available hosts

    View Slide

  64. Can be narrow or broad category
    Available hosts

    View Slide

  65. Lots of hosts offer git support
    Available hosts

    View Slide

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

    View Slide

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

    View Slide

  68. Leaves us with two hosts
    Available hosts

    View Slide

  69. Pantheon and WP Engine
    Available hosts

    View Slide

  70. Services

    View Slide

  71. Cheaper alternative
    Services

    View Slide

  72. Flexibility to chose your host
    Services

    View Slide

  73. How does it work?

    View Slide

  74. How does it work?

    View Slide

  75. Service like GitHub mandatory
    How does it work?

    View Slide

  76. Push to GitHub repository
    How does it work?

    View Slide

  77. Allows for complex deployments
    How does it work?

    View Slide

  78. Available services

    View Slide

  79. Lots of services out there
    Available services

    View Slide

  80. Only focus on two
    Available services

    View Slide

  81. DeployBot and DeployHQ
    Available services

    View Slide

  82. Plugins

    View Slide

  83. Final option
    Plugins

    View Slide

  84. Different from what we’ve seen
    Plugins

    View Slide

  85. Can’t deploy a WordPress site
    Plugins

    View Slide

  86. Only plugins and themes
    Plugins

    View Slide

  87. How does it work?

    View Slide

  88. How does it work?

    View Slide

  89. Connects plugins and themes
    How does it work?

    View Slide

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

    View Slide

  91. Webhook required for automation
    How does it work?

    View Slide

  92. How does it work?

    View Slide

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

    View Slide

  94. Available plugins

    View Slide

  95. GitHub updater and WP Pusher
    Available plugins

    View Slide

  96. Both plugins are almost identical
    Available plugins

    View Slide

  97. The big difference is the price
    Available plugins

    View Slide

  98. Questions

    View Slide

  99. Do it yourself

    View Slide

  100. More complicated to do
    Do it yourself

    View Slide

  101. But also free
    Do it yourself

    View Slide

  102. Remote repository

    View Slide

  103. Works like hosts seen earlier
    Remote repository

    View Slide

  104. Push code to repository to deploy
    Remote repository

    View Slide

  105. Offered by some WordPress hosts
    Remote repository

    View Slide

  106. Webhook

    View Slide

  107. Similar to the services from earlier
    Webhook

    View Slide

  108. Install custom webhook endpoint
    Webhook

    View Slide

  109. Push code to GitHub
    Webhook

    View Slide

  110. Also supported by some hosts
    Webhook

    View Slide

  111. Deployment tools

    View Slide

  112. Almost every language has a tool
    Deployment tools

    View Slide

  113. Deployment tools

    View Slide

  114. Your computer does all the work
    Deployment tools

    View Slide

  115. Also requires server configuration
    Deployment tools

    View Slide

  116. Not possible with regular hosts
    Deployment tools

    View Slide

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

    View Slide

  118. DebOps and Trellis
    Deployment tools

    View Slide

  119. Taking the stress out

    View Slide

  120. Lots of options available to you!
    No stress

    View Slide

  121. Most aren't that complicated
    No stress

    View Slide

  122. Never fear deploying code again
    No stress

    View Slide

  123. Questions

    View Slide

  124. Thank you!

    View Slide