23
What is CI? Azlam Abdulsalam

What is CI?

Embed Size (px)

Citation preview

Page 1: What is CI?

What is CI?Azlam Abdulsalam

Page 2: What is CI?

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

Page 3: What is CI?

Main Keywords

CI is a practice

Integrate work of everyone

frequentlyat least once daily

automated buildinclude tests

Page 4: What is CI?

Integrating Work of Everyone Quite Frequently!

Common Branch Strategies

Page 5: What is CI?

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

Page 6: What is CI?

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

Page 7: What is CI?

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

Page 8: What is CI?

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

Page 9: What is CI?

That is why you had SCM Managers! –Something was not working… and minimal integration!

Page 10: What is CI?

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

Page 11: What is CI?

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

Page 12: What is CI?

Wait…There is one more method!

Page 13: What is CI?

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

Page 14: What is CI?

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

Page 15: What is CI?

Automated Build

Page 16: What is CI?

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

• ………….

Page 17: What is CI?

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???

Page 18: What is CI?

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

Page 19: What is CI?

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

Page 20: What is CI?

Make the build self testing!include tests

Page 21: What is CI?

An Interesting Dilemma!

Page 22: What is CI?

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

Page 23: What is CI?

Thank You!