A Story of Continuous Integration


One day Mickey was taking a walk at the riverside when Minnie came running to him

Minnie – Hey Mickey, Wait for me!

Mickey – Hi Minnie, what happened?

Minnie – I need to talk to you

Mickey – Sure, tell me

Minnie – Do you know what is Continuous Integration?

Mickey – Sure I do, Minnie

Minnie – Great can you make me understand, like from scratch

Mickey – I know, the best way you understand is with a Story. Let me tell you one

Minnie – Great, let’s go to some quiet place

Mickey & Minnie went to a quiet place near the river

Mickey – Have you ever played the game LEGO

Minnie – Yeah, it was one of my favorites, I used lego blocks to create so many things, houses, cars, buildings, parks etc

Mickey Great, so let’s imagine you and your friends play together with lego blocks and create an awesome huge house

Minnie Wow, I can imagine

Mickey Now you have created the house, it has lots of features, it is a multi-story house with many rooms, a play area, kitchen, and washing area, it has moving doors and windows

Minnie Oh my God, I am back in childhood

Mickey Now just imagine you decide to keep this big lego house in a common area and any of your friends or you can go there and make changes or add new blocks, remove old blocks, etc

Minnie Ok, sounds cool

Mickey However, here is a problem, if people are making the changes independently and randomly without the presence of others, it can cause problems

Minnie Ok

Mickey Can you think of what can be the issues

Minnie Yeah, I know, Let’s say I made a change in the doors to make them sliding vs hinged doors, and others will not know about it

If some other friend added a block adjacent to the door, the door will not open and it will not work

Mickey Exactly, and this is what happens in Software Projects. Let’s say our Development team is working on a software application and if they work in silos and they don’t communicate the changes made by them to the team in a proper way, these kinds of issues will come regularly

Minnie Oh Yes!

Mickey If one person makes a change in one of the modules, it may break the changes done by some other developer in the same of different module

Minnie Yes, I can get that

Mickey Now let’s imagine, if we keep our Project at a common central repository and when any person wants to make any changes to the code, they will get a copy of the code from the central repository and work on it on their local systems

Minnie Good, so we are now not making changes directly to the main project but making a copy of it and working on our local systems

Mickey Yes, And after working, they merge the changes back to the code on the central repository and this commit of change triggers some automated tests, which run to check if the final code is working fine and nothing is broken

Minnie Wow! That will be awesome, It will save so much time and effort and will make the collaboration so efficient and organized

Mickey Yes, and that exactly is CI – Continuous Integration

Continuous integration (CI): A software development practice in which developers regularly merge (integrate) their code changes into a central repository, and automated builds and tests are run
This helps catch integration issues early and ensures that the codebase is always in a deployable state

Minnie Wow, I can understand the process now

Mickey In CI, we need a platform to keep our project/code, we call it Repository

Minnie Ok

Mickey Can you think of any such platform

Minnie – Hmm… GitHub?

Mickey – Yes, GitHub is very common, then there is BitBucket, GitLab, etc

And, we also need a tool that will help to pull, push and commit changes

Minnie Will that be Git?

Mickey – Yes, any Source code management tools like Git, SVN, Mercurial, etc

And we also need a platform where we can create jobs to run when the changes and commit to code happens

Can you think of a tool where we can create and chain multiple stages or jobs?

Minnie I know, Jenkins?

Mickey Exactly, there can be others like Bamboo, TeamCity, GitLab etc, So here on Jenkins we can create jobs to run some tests whenever there is a commit in the common repository

Minnie Great

Mickey So, whenever any developer will make any changes on the common code repository, it will trigger a Jenkins job, that will in turn run some jobs to do automated builds and run some tests to check the code is stable after the change and nothing else is breaking

Minnie What if the tests fail?

Mickey If the test fails, the team will know that this particular change is causing the issue and it can be reverted immediately

Minnie Wow, that will save so much time and efforts

Mickey Exactly, So to make Continuous Integration work we need

A Common Repository (like GitHub)
A Source code Management tool (like Git)
A CI Tool (like Jenkins)

Minnie And a team to work on this

Mickey Of, course Minnie

Minnie Wow, I can join the dots now

Mickey – Now when we also add a stage of testing and builds that make the code ready for release, it will be called Continuous Delivery (CD)

Minnie – So Continuous Delivery is CI + jobs to test and make the build ready for release

Mickey – Yes, and when we further add the Release process to this chain it becomes Continuous Deployment (CD)

Minnie – Okay this clears the terms Continuous Integration, Delivery and Deployment, I feel so good now

Mickey Great, Do you want to get a Pizza?

Minnie – No let’s sit here for some time. I want to enjoy the sunset

Mickey – Sure, Minnie

Minnie – You are my best friend

Mickey – I am always here for you 🙂


about the author  |  more stories

44