Jun 16, 2016 - Arnold Bechtoldt. Systems Engineer / Consultant @ inovex. ã Software-Defined Datacenters. ã Continuou
Continuous Integration for Fun and Profit
Arnold Bechtoldt Darmstadt, 16.06.2016 v2
Arnold Bechtoldt Systems Engineer / Consultant @ inovex 〉 Software-Defined Datacenters 〉 Continuous Integration/Delivery 〉 DevOps
2
Scenario
The Product
IMAP/POP Backend Frontend
Middleware
SMTP Backend MySQL Backend
4
Test Matrix Rails-FE Mail-MW Calendar-MW
v1, v2, v3, ...
Customer Feature Set 1
DBMS
v1, v2, v3, ...
Customer Feature Set 2
K/V 1
X
v1, v2, v3, ...
X
Customer Feature Set 3
K/V 2
v1, v2, v3, ...
Customer Feature Set 4
MDA Mail-Store
...
...
MDA IMAP/POP Proxy Mail-FTS MTA Mail-In MTA Mail-Out
5
Sad Stories from Real World
We can‘t run integration tests in parallel.
Running all of our tests takes ages.
Our integration tests are fragile.
Producing a bugfix release is hard work.
Time For A Plan
The Plan: Building A Private Travis CI Clone
12
GitLab to the Rescue!
gitlab.com/bechtoldt/tabellarius
13
Improving the Workflow 1. 2.
Git-Pushes go to feature/bugfix branches Every Git-Push triggers a test
3.
Tests run in prod-like environments
4. 5.
Tests run in isolated/dedicated environments Master branch keeps “stable”
6.
Make it easy to improve/add tests
14
Pipeline (simplified) Integration
Delivery
run-tests.node4 release-artifact Git Push
deploy-artifact
run-tests.node5
15
GitLab CI Config stages: - tests - release - deploy
run-tests.node4: stage: tests image: node4 script: - npm test
release-artifact: deploy-artifact: stage: release stage: deploy script: script: - npm release.prod - npm deploy.qa
run-tests.node5: stage: tests image: node5 script: - npm test
16
GitLab Code Build Status
17
GitLab CI Pipeline
18
GitLab CI Pipeline (2)
19
Conclusions
Conclusions
〉
Spawning integration test environments at ludicrous speed
〉
Similarity to production leads to faster bugfixing
〉
Isolated testing improves test (=product) quality
〉
Parallel testing increases work efficiency
21
A voice in my head..
22
Arnold Bechtoldt inovex GmbH
[email protected] CC BY-NC-ND
inovex.de
+ArnoldBechtoldtGER
github.com/bechtoldt
arbe.io
youtube.com/inovexGmbH
Backup
24
GitHub/Travis Code Build Status
25
Travis CI Pipeline
26
Travis CI Pipeline (2)
27
Jenkins CI Pipeline
28
Jenkins CI Pipeline (3)
29
Jenkins CI Pipeline (4)
30
Jenkins CI Architecture
Jenkins Slave Gitlab
Jenkins Master
Jenkins Slave
Artifactory
Jenkins Slave
31
Toolset Tool
Purpose
GitLab
Git Repository + CI Server
Docker
Container Technology
Docker-Compose
Container/Service Management
Bash + Confd
Image/Container Configuration
Artifactory
Artifact Repository
32