What are "Continuous Deploying", "Continuous Delivery", and "Continuous Integration"? Is it possibile to integrate
WordPress in a continuous development process? And how?
WooCommerce Expert @gmazzap github.com/gmazzap https://gmazzap.me PHP developer since 2005, first met WordPress in 2006. Moderator at wordpress.stackexchange.com Since 2016 WordPress Engineer at: Giuseppe Mazzapica Continuously Deploying WordPress Continuously Deploying WordPress
pratices to automate the process that goes from the writing of source code to its release in production. Premise of continuous deployment is continuous integration. Continuously Deploying WordPress
and tools, but continuous deployment implies the automation of the transition from development cycle to release cycle, whereas that transition is not automated for continuous delivery. Continuously Deploying WordPress
Release Cycle “You’re doing continuous delivery when: Your software is deployable throughout its lifecycle Your team prioritizes keeping the software deployable over working on new features Anybody can get fast, automated feedback on the production readiness of their systems any time somebody makes a change to them You can perform push-button deployments of any version of the software to any environment on demand Martin Fowler Continuously Deploying WordPress
team clones, edits and updates code repository frequently. At every update, unit tests are started automatically and the QA team is notificated so they can start code review. Continuously Deploying WordPress
continuous integration At the end of development cycle code is automatically released in a production-like environment (stage), and other tests are automatically started Configuration of the servers is automated, reproducible, scalable, and under version control. It is also manages different environments.
ends successfully on stage (acceptance and user acceptance test pass) the code is released in production with the same routine that occurred for the stage environement. Release in production may happen: automatically, that’s continuous deployment manually (push-the-button), that’s continuous delivery
Control Automated tests at every step If any test fails, the cycle stops and starts over The closer the production environement, the more tests are “black box” Dev/Prod Parity All environments share same setup and technologies Code is environment agnostic Continuous Monitoring
estimations usability tests performance monitoring errors monitoring feedback analysis e g a t S / t s e T quality assurance feature management feature planning Continuous development, ensuring the code is environment agnostic, allows for different focuses for different environments being carefree about the existence of problems related to each specific environment g n i r o t i n o m Development Production
more a mindset that aims at integrating different skills available across company teams, sharing decisions and responsibilities. Application code is not a separate element, but it is part of an integrated process, which always evolves, and whose reason to be is the research of business value maximization.
tool. Specifically, it is a tool for writing website or web application code. So the question is: is it possible to integrate WordPress in a continuous development process? If so, how?
Unit, Integration Version Control Build Continuous Integration Continuous Delivery Continuous Deployment Code Deployment Tests Platform Tests Acceptance Maintenance Monitoring to Stage Environment to Production Environment Environment Configuration Stage, Production Release Cycle Development Cycle
does not affect the rest of the process, it is only needed to take into account that the codebase will be made by different elements: WordPress core 3rd-party code (themes, plugins) Custom code (themes, plugins)
version control, but also to automate each step of the development cycle. The most effective solution to obtain both things is to keep custom code under version control and to treat 3rd-party code (including WordPress) as an external dependency.
have a complex “dependency tree”, which is impossible to maintain without a dependency management tool In the PHP world, where also WordPress lives in, the only (as of today) possible solution is Composer getcomposer.org
which is an obstacle to environment agnostic code. Different projects which integrate WordPress and Composer also allow to manage different environments, but aiming for cross-environment parity, different environments should be configured via environment variables.
put in practice the current best practices about deployment of PHP code, paving the way for the usage in WordPress context of tools designed for "generic" PHP applications.
CLI Allowing the execution of WordPress-specific tasks (i.e., creating a user, or activating a plugin) from the command line is a key component towards complete WordPress deployment automation. wp-cli.org
WP CLI (maybe with the help of libraries like Bedrock or WP Starter), WordPress stands like any other application, PHP or otherwise, perfectly integrable in a process of continuous development.