This document provides an overview of continuous integration (CI), continuous delivery (CD), and continuous deployment. CI involves regularly integrating code changes into a central repository and running automated tests. CD builds on CI by automatically preparing code changes for release to testing environments. Continuous deployment further automates the release of changes to production without human intervention if tests pass. The benefits of CI/CD include higher quality, lower costs, faster delivery, and happier teams. Popular CI tools include Jenkins, Bamboo, CircleCI, and Travis. Key practices involve automating all stages, keeping environments consistent, and making the pipeline fast. Challenges include requiring organizational changes and technical knowledge to automate the full process.
3. 3
What's Continuous Integration?
Continuous integration (CI) is a practice of integrating code from
multiple developers into a central repository (or branch), multiple
times per day
A CI build consists of automated processes that:
• Run automatic code quality scan, and generate a report how well
latest code changes adhere to good coding practices
• Build code and run any automated tests (mostly unit tests) that
are written to make sure the changes don't break any
functionality
• Generate and publish a test coverage report
5. 5
What's CD?
There're two meaning of CD. It stands for Continuous Delivery,
and Continuous Deployment as well
6. 6
What's Continuous Delivery?
Continuous delivery is an extension of continuous integration where
code changes are automatically prepared for a release to
production.
It expands CI upon deploying code changes to testing environment
and running functional test, UI test, performance test, security test
and so on after build stage
7. 7
What's Continuous Deployment?
Continuous deployment goes one step further than continuous
delivery.
Every change that passed all stages of production pipeline is
released to customers without any human intervention
Only a failed step can prevent a new change to be deployed to
production
9. 9
Benefits of CI/CD
Higher quality
• Less bugs get shipped to production as regressions are captured
early by automated tests
• Developers are alerted as soon as they break a build and can
work on fixing it before moving to another task
10. 10
Benefits of CI/CD (cont.)
Low risk releases
• Making a release is easier as integration issues have been
solved early
• Easy to fix in case of problem as you deploy small batches of
changes
11. 11
Benefits of CI/CD (cont.)
Lower costs
• Cost for fixing an issue in development phase is much lesser
than when it already was in production
• Testing costs are reduced significantly since CI/CD server takes
care of running hundreds of tests in the matter of seconds
12. 12
Benefits of CI/CD (cont.)
Better products
• Team are freed to focus their effort on application business logic,
user experience, and other high-level activities that bring more
value to end users/customers.
• Team is now focusing on what customers care about most
• Techniques such as A/B testing enable team to test ideas with
users before buidling whole feature
13. 13
Benefits of CI/CD (cont.)
Time to market faster
• When everything is automated, team doesn't have to spend
days, even weeks preparing for a release anymore
• CI/CD is also removed a large amount of re-work effort that's
often a reason to postpone a release.
• Customers see continuous stream of improvements and quality
increases every day, instead of every month, quarter or even
year
14. 14
Benefits of CI/CD (cont.)
• Happier team
• CI/CD makes releases are less painful, so it reduces team
burnout
• Continuous deployment is excellent way to take pressure off
the team since there's no "release day" anymore :)
• When an application is released more frequently, the team can
see more often outcomes of the work they have done.
16. 16
Most popular CI Tools
Name Site Opensource On-premise
Jenkins https://jenkins.io/ Yes Yes
Bamboo
https://www.atlassian.com/softwa
re/bamboo
No Yes
Circle CI https://circleci.com/ No Yes
Travis https://travis-ci.com/ Yes No
Drone https://drone.io/ Yes Yes
TeamCity No Yes
GoCD https://www.gocd.org/ Yes Yes
17. 17
Practices
Automated everything: build, test, deploy, monitor
Keep everything in source control system (Git, SVN, etc...)
Commit your code changes to repository frequently
Do not commit directly to delivery branch, use feature branches and
MR/PR workflow
Do not merge broken code into delivery branch
Every commit should be built
Build only once and promote results through pipeline
Do not use dynamic version for dependencies (e.g. latest,
production)
18. 18
Practices (cont.)
Run tests on ephemeral environment when possible
Run fastest tests early
Deploy the same way to every environment
No-downtime deployment
Use container technology (Docker) if possible as makes
building, deployment simple
Automated feedback on the entire process
Make everyone can see the pipeline results
Keep pipeline fast
19. 19
Practices (cont.)
Every team member is responsible for fully own their features from
development to CI/CD pipeline in order to enable them to iterate
quickly without being blocked by a dedicated team (or a person)
Take advantages of practices like Configuration as
Code, Infrastructure as Code, Pipeline as Code, etc...
20. 20
Challenges when implementing CI/CD
Require organization changes and mindset shifts
Deep technical knowledge to automate the entire process
Team is required to use various technologies depending on
application stack
Infrastructure cost is a potential issue since team requires at least
two identical environments (staging and production) that allows the
team tests new changes without disrupting production.
Etc..
21. 21
Bear in mind CI/CD is not magic. It's about continuous
daily improvement. If it's painful, you're doing it wrong.
Do it again, and bring the pain forward.