Set up a Pull Request Workflow for your Drupal site's Code, Config, and Content
Pull requests have proven to be not only highly successful, but a nearly ubiquitous way to develop all kinds of software. Services such as GitHub, BitBucket and GitLab provide a place to review suggested changes, make comments on the code, and integrate with other services, like automated test runners such as Circle CI, Travis CI and CodeShip. Once the code reviews are complete and all of the tests are passing, the code can be easily merged back into the master branch.
What if that same workflow could be applied to the development of a Drupal site? In this session, we will demonstrate a pull request workflow for a Drupal 8 site. You will learn how to:
- Use Composer to describe your Drupal 8 site.
- Commit only the source files relevant to your site in your git repository.
- Use GitHub and Circle CI to build your site code, compile resources and deploy to a fresh test site for every pull request.
- Manage test fixtures to allow developers to collaborate on your site without needing to copy the live site’s database.
- Pull a sanitized copy of the live site’s database into a test site for those times when you really want to see the new code working with real customer data.
- Manage site configuration such that the live site’s configuration is stored in the site’s git repository, and used to create the test configuration -- overriding with test values where necessary.
- Clean up test sites when the pull request is merged.
The example target environment for deployments will be Pantheon, using the Terminus cli to create a new development environment for each request; however, these concepts can easily be applied anywhere a site-creation tool is available.