Jenkins 2 pipelines as a Continuous Integration platform for Drupal
In this presentation you will see how you can utilize the newest Jenkins 2 Pipelines to implement Continuous Integration/Deployment/Delivery for the Drupal site while respecting principles like Infrastructure As Code, Configuration As Code, DRY (Don’t repeat yourself) and Open/Closed principle (from SOLID principles).
Adyax already delivered several site factories based on this system and we want to share with you the knowledge and the results.
You will see the whole process:
- pushing a commit into self-hosted (Gitlab) or private Github repo;
- building the docroot from the several sources;
- performing deploy procedures, including drush updb, drush config-import, drush cache-rebuild, etc.
- performing auto-tests (on the example of Behat) on servers (example will be performed on Acquia hosting platform)
and everything will be in the same Pipeline configured as separate stages.
You can have the universal reusable solution for your project that just needs to be configured for the specific project requirements.
Some of the features that will be shown during presentation:
- Auto-generation of deploy pipelines for each branch/state (e.g. Development, Staging, Production) configured.
- Utilizing different approaches to managing code structure such as Composer-based workflow and “all-code-in-repo” solution in the same docroot.
- Auto-checking that code was actually delivered to the server before starting drush deploy procedures and testing (very useful for platforms like Acquia where the code is delivered to the server after pushing into Acquia Git with some delay).
- Universal deploy script that can be used for any projects.
- Additional project-specific deploy scripts that can extend - DRY (or override) basic deploy script - useful when you should delegate this part of the responsibility to another team, and you can even control what drush commands (not limited to drush-only) or command options can be used for the specific projects! In other words - project team can own their deploy scripts.
- Configuration as a code on Jenkins side: All Jenkins jobs (pipelines) will be stored as code in Git and will be re-generated on Jenkins side in case of code changes with the help of Job DSL plugin.
- Configuration as a code on Drupal side: Every configuration change for Drupal should be performed in code and then processed on Dev, Stage, Prod servers during code deploys.
- How to auto create URLs and databases on hosting platform (with Acquia as an example) based on your multisite setup in code.
- How to perform automatic backups before code deploys (for example on Production).
- How to copy whole sites (including files and DB) inside docroot or between different docroots with one click!
- How to add custom actions to provide any additional functionality specific for your projects.
- And much more.
Every listed feature is a part of code package that will be presented.
Also, you will see many other features & tricks with Jenkins that can help you to implement your own specific workflows.
Note: Jenkins 2 Pipeline formerly was known as Workflow plugin for Jenkins.