No description, website, or topics provided.
Switch branches/tags
Clone or download
Latest commit 92f2678 May 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Use puppeteer May 30, 2018
includes Use puppeteer May 30, 2018
.babelrc BackstopJS locally with Node Feb 8, 2018
.gitignore BackstopJS locally with Node Feb 8, 2018
LICENSE Initial commit Feb 7, 2018
README.md Make it clearer there are two branches/steps Feb 12, 2018
index.js Update opn so wait is false May 21, 2018
package-lock.json Update opn so wait is false May 21, 2018
package.json Update opn so wait is false May 21, 2018

README.md

Workshop: Automating WordPress Updates Example Repo

This repository is an example for the LoopConf 3.0 Automating WordPress Updates workshop (2/21/2018).

Workshop Description

Your WordPress site really loves to be updated! Be it core, plugins, or themes there is a LOT of code that you need to update for every site. However, even with tools like wp-cli, updating your site is hard work.

You need to apply updates, test updates, and deploy updates. And do it for every single site for which you are responsible every single time an update comes out.

Enter "Automatic WordPress Updates" and making the robots do updates for you. This workshop will involve using a Continuous Integration and Visual Regression solution to automate WordPress updates both with confidence and at scale.

Prerequisites

You will need:

  • A local development environment with Node JS/NPM and wp-cli
    • (Optional) Install BackstopJS globally. This will let you play around with visual regression outside the workshop
  • A live, web-accessible WordPress site
  • A local WordPress copy or alternative (e.g. staging) environment of the site above
  • To be able to write and execute scripts. This workshop uses JavaScript and bash
    • (Optional) you can use whatever language(s) you are comfortable with but will have to convert the scripts

Getting The Code

For the master branch either clone this repository using Git or download the .zip file.

For the multiple-sites branch run git checkout multiple-sites in your local clone directory or download the .zip file.

Two Parts

This example has two parts. You should start with the first part found in the master branch.

After completing the steps on the master branch you can do the second part found in the multiple-sites branch.

Instructions

After setting up the repository locally (see above) you will need to:

  1. Run the command npm install to download dependencies
  2. Run the command npm run start
  3. Check out the results from the sample test
    • Should open in your browser automatically
  4. Edit includes/backstop.json
    • Set referenceUrl in scenarios to your production site URL
    • Set url in scenarios to your non-production environment (local, staging, etc.) URL
    • Start your local environment if needed
  5. Run the command npm run start
  6. Check out the results
  7. Edit includes/backstop.json
    • Try changing viewports or adding more scenarios
  8. Run the command npm run start
  9. Check out the results
  10. Update WordPress on your non-production environment (local, staging, etc.)
    • Use the WordPress admin or wp-cli
  11. Run the command npm run start
  12. Check out the results

Troubleshooting If you are having issues with the script hanging or BackstopJS taking a long time there may be headless Chrome instances that didn't close properly.

Try pkill -f "(chrome)?(--headless)" on Mac/Linux or Get-CimInstance Win32_Process -Filter "Name = 'chrome.exe' AND CommandLine LIKE '%--headless%'" | %{Stop-Process $_.ProcessId} in Windows PowerShell.

Branches

master

The master branch is the starting point for the workshop where we will be working with BackstopJS.

multiple-sites

The multiple-sites branch is where we will be working on scaling, testing more than one site.