continuous delivery su progetti java: cosa abbiamo imparato facendoci del male
TRANSCRIPT
Continuous Delivery in JavaCose che abbiamo imparato facendoci del male
Codemotion Milano ‘15
@pdincau
Here We Are
@pierodibello
Continuous Delivery?
What is
“Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to
production at any time. ”Martin Fowler*
* martinfowler.com/bliki/ContinuousDelivery.html
“Continuous Delivery is nothing more than reducing the stress you get when you deliver business value to the customer ”
My Team*
* Come and ask!
n t Continuous Delivery...
What is
Continuous Integration
Continuous Deployment
“Safety” Deploy rules
Technically Speaking
Deploy any specific working version to
production with confidence
3 ways
Rodeo Style
No tests
Manual deploy
Snowflake environments
Non predictable outcome
Few or very little collaboration
Rodeo Style
By the book
Fast Feedback
Done is released
Shared responsibility
Everything is automated
Repeatable and reliable process
Start small and iterate
Once upon a time...
We did know...
Previous deployment process was painful
Database continuously change
Different environments
Itera
tion
n.1
No Automation
Environment replica on AWS
Manual build
Manual DB migrations
Deploy with scp to remote JBoss
It was our own choice...
...but we felt like this
No automation at all
When was our last deploy?
A taste of AutomationIte
ratio
n n.
2
Set up a basic Jenkins installation
Test and build triggered on push
DB migration using Liquibase
Task to deploy on AWS
This worked for a while
Errors in MyBatis DB mappers
Wrong/Missing wirings
Meanwhile...
Yay! Environments are ready!
Deploy EverywhereIte
ratio
n n.
3
New Jenkins job to run integration tests
Track slowest tests
First official deploy an all environments
…with different DB drivers !#$?!
Duplication
Incorrect use of mvn profiles
N-builds for N-environments
Long build and deploy time
Single ArtefactIte
ratio
n n.
4
Got rid of configurations using JBoss
*Unique* artefact for all environments
Deploy version X.Y.Z from Nexus
We started getting fast
But QA were not so happy
Branches, branches everywhere!
Make them happyIte
ratio
n n.
5
An environment for QA
Tags over branches
Track deployed version
Devs love QAs
Acceptance tests
Explained values and
motivations to Product Owner
Self-service deploy
Remove Candidate Clean Up
Clean Up
Build it...
Migrate !
Database
Fetch Unit Tests Build
Build
Integration Test !
Integration
Deploy Publish UAT
QA and Publish
Frontend Angular !
Web
...and deliver it
Deploy ESB !
ESB
Deploy staging !
Deploy Staging
Deploy API Deploy Core
Backend
Migrate !
Database
Things we are experimenting
Parallelization
Environments Provisioning
Jenkins under git
Squash migrations to snapshot
What we would do differently...
Pipeline with “placeholders”
Extract configurations asap
Explain at the beginning the values behind
Things we will keep doing...
Build the pipeline iteratively
Share pipeline responsibility
Use the tool that best fit your needs
Recommended reading
Take a look at these
Real-World Strategies for Continuous Delivery
with Maven and Jenkins
https://www.youtube.com/watch?v=McTZtyb9M38
Visualizations of Continuous Delivery
http://continuousdelivery.com/2014/02/visualizations-of-continuous-delivery/
That’s all!
@pdincau@pierodibello
https://creativecommons.org/licenses/by-nc-sa/3.0/
Thanks!