CSIT 314 - Topic 6 - Principles and Practices of Continuous Integration and Delivery - CI-CD
CSIT 314 - Topic 6 - Principles and Practices of Continuous Integration and Delivery - CI-CD
Software Development
Methodologies
Principles and practices of continuous integration and delivery
(CI/CD)
Continuous
Integration (CI)
What is integration
Acknowledgement: some materials of following slides are adapted from “Continuous Integration” by Martin Fowler and GitLab
documentation.
Top-down integration
• completely automated
• usually through the execution of a single script
• a build always begins by retrieving code from the source
code repository
• unless terminated prematurely, the end product of a build
is always executable code
• notification of build status always occurs through a
feedback mechanism
The build cycle
• Basic build cycle consists of these key steps:
– Developer commits changes to the source code repository
– Build server executes the master build script, or delegates
execution to another server
• Checks out source code
• Builds executable version of the application
• Runs other jobs, such as testing and code inspection
– Team is notified of build results through a feedback mechanism
• If alerts are generated, the team takes immediate action to
correct problems
• If a code fix is needed, developer commits the corrected code
back to the repository; this action kicks off a new build
cycle.
Improving Build Speed
• Daily commits
• In general, the more processes included in the build, the better the
quality of the final product
• What is IT infrastructure?
– Physical machines, devices, OS, databases, and any other
systems that are used to run a software application.
• Infrastructure as Code
– the whole IT infrastructure can be treated as if they are
software
– setup, configured and changed automatically through writing
code
• Infrastructure as code is the prerequisite for common CI/CD
practices
Infrastructure as Code
• A CI build can:
– Drop an existing database
– Inspect database scripts for compliance with project
practice
– Create, configure, and populate data
– Run automated unit tests to verify that everything is
working as expected
Benefits of CI
• Increased productivity
– Enables shorter feedback cycle when changes are made
– Code is kept in a “releasable” state
– Code gets back into the hands of testers quickly
– Enables more frequent releases with new features
• Improved quality
– Frequent testing identifies bugs
– Multi-platform builds help in finding problems
• Reduced Risk
– Reduces uncertainty greatly because at all times the team knows what
works, what does not, and what the major issues are.
Barriers to CI