Upload
azlam-abdulsalam
View
222
Download
0
Embed Size (px)
Citation preview
What is CI?Azlam Abdulsalam
What is CI?
“Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly”
-- Martin Fowler, May 2006
Main Keywords
CI is a practice
Integrate work of everyone
frequentlyat least once daily
automated buildinclude tests
Integrating Work of Everyone Quite Frequently!
Common Branch Strategies
Release Feature Branching
main
Feature 1
Feature 2
Time
C C C C C C
C C C C C
B B M M
B
M
C Commit
Branch
Merge
Release Feature Branching with Promiscuous Integration
main
Feature 1
Feature 2
Time
C C C C C C
C C C C C
B B M M
B
M
C Commit
Branch
Merge
Release For Customer A
MM
Release Feature Branching…
main
Feature 1
Feature 2
Time
C C C C C C
C C C C C
B B M M
B
M
C Commit
Branch
Merge
Release For Customer AM
Release For Customer BM
MM
Let’s add bit more complexity! – Fixes in Production
main
Feature 1
Feature 2
Time
C C C C C C
C C C C C
B B M M
B
M
C Commit
Branch
Merge
Release TaggingT
hotfix
M
M
M
C
T Tag
M
MM
That is why you had SCM Managers! –Something was not working… and minimal integration!
Integration Based Branching
integration
Time
B
M
C Commit
Branch
Merge
T Tag
B
main
B
Feature 1
M
C C C C
M
Feature 2
C
M
M C C
Feature 2
B
C C C C MFeature 3 C C
Feature 2
M
Feature 1
C
M
M
MT
Integration Branching is widely used and solves some of the cross merging issues… and very effective if feature is short lived.. Like agile!...
It’s not pure CI.. But currently most common implementation
Wait…There is one more method!
Trunk based development
main
Time
B
M
Branch
Merge
T Tag
C Commit
F1 : C F1 : C F2 : C F2 : C F1: C F3: C
Feature 1 Toggle
Feature 2 Toggle
Feature 3 Toggle
F2 : C
T
F1 : C F1 : CF3: C F3: C F3: C F1 : C
T
F3: C
T
Trunk Based Development
• Continuous Integration
• Adaptive scheduling
• Collaborative design
• Operational and Business Empowerment
• Not Easy• Feature Flags left to live can cause issues in production• Coding Complexity in managing runtime flags• There are frameworks to manage feature complexity
Automated Build
An Idea of the build process
• Pre processing
• Compiling Multiple Files
• Moving Files Around
• Packing Resources
• Creating Executables or Jar’s or DLLs
• Loading Schema into Databases
• ………….
An Idea of the build process
• Pre processing
• Compiling Multiple Files
• Moving Files Around
• Packing Resources
• Creating Executables or Jar’s or DLLs
• Loading Schema into Databases
• ………….
Can all this steps be automated???
Automating the build process
• One single command to generate a build….• For eg: gradlew assembleProdRelease <--- CSSM Mobility
• And How?• Using tools such as
• Java - Ant, Maven
• .NET -> Nant, MSBuild
• Unix -> Make
Automating the build process
• One single command to generate a build….• For eg: gradlew assembleProdRelease <--- CSSM Mobility
• And How?• Using tools such as
• Java Ant, Maven, Gradle
• .NET Nant, MSBuild
• Unix Make
Anyone should be able to bring in a virgin machine, check the sources out of the repository, issue a single command, and have a running system on their machine.
Good Build Tool should analyse what is to be built depending on the change
Make the build self testing!include tests
An Interesting Dilemma!
Some Pointers!
• Entire build process including testing has to be fast• No more than 15 minutes per commit
• But, it has to validate that bugs are not introduced as well
• Balance the needs of bug finding and speed so that a good commit build is stable enough for other people to work on.
• Some Ideas• Deployment Pipelines
• Unit Testing
• Smoke Testing
Thank You!