Continuous Delivery
praktika ir nauda
2017-11-09 VilniusPHP 0x3C
Žilvinas Kuusas
Žilvinas Kuusas
lead developer
Estina / ISIGN.io
Twitter: @kuusas
Email: zilvinas@kuusas.lt
2nd of december, 2017
Continuous delivery
Release valuable
and reliable software
FAST
Speed === €€€ *
* € - the unit to measure the business value
10 mins Client
Giving some
requirements
Developer
Writing some lines of
code
FTP
Deployment process *
* triggered “on file save”
PROD
It’s DONE!
Fast delivery
What can possibly go wrong?
¯_(ツ)_/¯
The bigger your project grows - more problems you get
● ISIGN
○ 3 products
○ X shared components
● Needs
○ Deploy any time, any version
Where it all began?
Managing risks
● Identify the main project risks
○ Buggy deployments
■ Availability
○ Software quality
● Risk mitigation
○ Automated tests
○ Deployment process
■ Deploy to staging
■ Schema migrations
■ Rollbacks
Business
Says “I NEED STUFF”
Developer
Writes few lines of
code, some lines of
tests. DONE!
BIG AND
Mr. Jenkins territory
SCARY
PROCESS
Operations guy
“scripts”
PROD
Finally, it’s
available on prod!
DONE DONE!
I write code, aaaand it’s done!
Is it “done” or is it “done done”?
Everybody should be responsible
for delivered result
It is done only when it is
DEPLOYED
Identifying issues
● Developer’s DONE doesn’t correlate with business expectations
● Developer is not familiar with the automated process
● Code reviews takes a lot of time
● Operations guy doesn’t know what developers are doing
● And we have translations guy! We can call him John. He knows nothing.
Developer deploys
using automated
scripts!
Team effort - from the beginning to the end
Business
Says “I NEED STUFF”
Developer
Writes few lines of
code, some lines of
tests!
Testing
Mr. Jenkins runs tests
Code reviews
Deployment PROD
It’s DONE!
Integrating team members into the process
● Communication
● Responsibility boundaries
● Everybody has to know what he is doing
Orchestrating the delivery process
● Atomic tasks
● Atomic commits
● Easy to read
● Easy to review
● Easy to test
● Deployable to prod
Don’t postpone, merge it!
● Avoid long living branches
● Avoid versioning trees
● Big merges leads to
missing features
Deployed === Delivered === €€€
Developer’s
satisfaction level
Business can provide quick and
effective feedback
Where to start?
The practice.
Everything
begins with a
ticket
“We need to have ‘premium users’
and ‘free users’ which will have
portal usage limits.
Premium users also will get
premium features*, for which users
are going to pay by credit card**” ...
Split tasks into small chunks
Splitting
payments
● Credit card processing
● Recurring payments
● Invoices
● ...
Splitting credit
card processing
by function
● Credit card processor
integration
● Credit card processing
○ On successful payment
○ On 3D-secure request
■ On success
■ On failure
○ On unsuccessful payment
■ Not enough funds
■ Invalid CC
● UI (credit card form)
Splitting credit
card processing
by abstraction
● Frontend
○ HTML
○ JS
● Backend
○ Data validation
○ Processing
■ Pre …
■ Post ...
○ Persistence
● 3rd party integration
○ Library
○ Bridge
It forces you to think
before writing the code
Small tasks -
clear intentions
Everybody knows what they are doing
● Coding
● Reviewing
● Testing
● Deploying
It’s easier to focus
on small goals
Focus == Quality
● Do not overthink
● Do not overengineer
● Do only what you need to do *
* always improve the codebase
How small it should be?
One developer - one deployable feature per day.
It’s the way to write testable code
Allows quality code reviews
Distribute workload
Reliable and predictable releases
The final touch
Automation over documentation
TDD + Functional tests
Monitoring & Alerting
Build better products!
FASTER
QUESTIONS?
Continuous delivery

Continuous delivery