10 tips for
continuous
integration
DrupalSouth Auckland
17 Nov 2017
Hello
My name is...
Vladimir Roudakov
Brisbane, Australia
Automation /
Development /
Training
@VladimirAus
Audience
Agenda
● CI/CD
● Services
● Preparation
● 10 tips
● More...
Continuous
Integration
● development practice
● periodic commits to
shared repository
● can be verified by an
automated build
Continuous
Integration
GOAL
detect problems early
Continuous Delivery
● approach
● teams produce
software in short cycles
Continuous Delivery
GOAL
the software can be reliably
released at any time
Services
● Code GIT repository
● CI runner
Code GIT repository
CI RunnerServices
What to know
more?
Disclaimer
Praparation
Services
Praparation
Services
Praparation
Images
● Operating system
● Official images on
Docker hub
● Custom images
Praparation
Variables
● Name your variables
accordingly
● Secure if possible
Praparation
Cache
● Sharing between
images
● File sharing
● Database sharing
Praparation
Dependencies
● composer
● npm
Praparation
Services
● Database
● Testing
● Others?
1. Renewals
● Certificates
● Subscriptions
● Renewals
1. Certificates
1. Certificates
1. Certificates
2. Linting
Standard
● PHP Code sniffer
● ES / Javascript linting
● SASS Lint / CSS lint
2. Linting
Additional
● D8 configuration
● Naming conventions
● Shell configuration
3. Code Quality
● Complexity
● Violations
3. Code Quality
3. Code Quality
3. Code Quality
4. Unit testing
● PHPUnit was added to
Drupal 8
● SimpleTest is still
supported but is
deprecated
What to know
more?
5. Drupal Installation
● Test profile installation
● Test db update
● Test config update
● Test dependencies
● Test core update
● Test modules update
Make sure your profile +
modules configuration still
works
6. End to end testing
● User like testing
● Selenium based stack
● Mimics user
● Based on user story
● Provides
comprehensive report
● Run one test / all /
conditional
What to know
more?WordCamp Brisbane 2017
https://2017.brisbane.wordcamp.org/session/testi
ng-any-day-guide-to-end-to-end-test-driven-word
press-projects/
7. Updates
● Environment update
● OS
● PHP / Apache / MySQL
● Drupal Updates
● TIP: Fail on security
updates
● Composer Updates
8. Notifications
● Email
● Chat
● Issue tracker
9. Artefacts
Logs
● Logs
● Release notes
● Test Reports
9. Artefacts
Release notes
● Logs
● Release notes
● Test Reports
9. Artefacts
Test reports
● Logs
● Release notes
● Test Reports
What to know
more?
10. Deployment
● Push to your
environment
● Spin off new
environment
Consideration
● Security
● Cache
● Limitations
Consideration
Security
● Keep keys private
● Don’t check in
passwords
What to know
more?
In conclusion
GOALS
CI: detect problems early
CD: the software can be
reliably released at any
time
Save time
Go automate!
Questions?
Hustle me
Vladimir Roudakov
vladimir@tomato-elephant-studio.com
@VladimirAus
References
● https://en.wikipedia.org/wiki/Continuous_delivery
● http://www.phpmetrics.org/
● https://phpunit.de/
● https://codeclimate.com/
● https://medium.com/netflix-techblog/developer-experience-lessons-oper
ating-a-serverless-like-platform-at-netflix-a8bbd5b899a0
● https://www.drupal.org/docs/8/phpunit/running-phpunit-tests
Services
● https://gitlab.com/
● https://bitbucket.org/product/features/pipelines
● https://docs.acquia.com/acquia-cloud/cd/pipelines
● http://try.drone.io/
● https://circleci.com/
● https://codeship.com/
● https://github.com/
● https://travis-ci.org/
● https://aws.amazon.com/devops/continuous-delivery/
● https://papertrailapp.com/
● https://www.sumologic.com/

10 tips for continuous integration