CI/CD... Whats that buzz !
I have been reading a lot about CI/CD model of development these days and the concept is pretty hot in the IT industry and almost everyone around is talking about this especially when you are working in DevOps. I thought of writing something what I understood !
CI/CD stands for "Continuous Integration and Continuous Deployment". As the name suggests, the concept or theory which works for the software development of a product in a continuous manner. It develops continually and integrates with the existing software.
To clarify and justify my statement, let me tell you about history of this concept and how it came into existence. To know about this, you have to know about "Water Fall model" of software development
Water Fall model : Imagine a waterfall. You see the water comes from top and has various steps before the it hits the ground.
Same way, in software development, there are various steps when a software goes through before it comes out in market. This is the earliest model that was used for software development. The reason it was called as waterfall is because of the below steps
Waterfall model was suitable when there is no change in the requirement meaning once the requirement is collected and design is built, development will be started and goes on until it gets delivered. There is no scope of any change in between. Well, this is good when the project is short and software does not have much dependencies and when the requirement is clear but think in another way, if you need to make few changes in the software development may be as per the change in the requirement or customer came up with different feature or may be something else like miscommunication between customer's requirement and the product I delivered. Now you will have to demolish this entire hard work and start from scratch from requirement collection till its delivery. Plus it would take longer time than expected e.g. 6 months or 1 year or may be more depending on the software and . You know the technology is changing rapidly and Mr. customer would not wait for you this long.
So this traditional way of approach was changed when the software development life cycle adopted new method called "Agile". Let me give you an interesting example of restaurant to explain the concept of Agile. Imagine you go to a great restuarant and check the menu and you see a new dish. You want to order it but your are not aware of what it is and will you like it or not. Now, Before you order it, what if, if you get opportunity to have tester of that dish. Nothing greater than that, isn't it ? Its even great for restaurant too. If that dish matches your expectation, you can order the entire course and if not, you can have something else. So here restuarant would not waste its resources and you would get what you want. Same way is the "Agile" methodology. You will be delivering your customer a ready product in every 2-3 weeks. Not the entire product but the parts of it. Let's say you have 5 features in your software, you will be delivering one feature at one moment of time. Brilliant part of this method is that you will be getting constant feedback from customer
Now this is one thing, what if when you have different modules of that software and each module is given to different developers.
So those developers will be writing codes and will be testing it individually. You must admit the funny but strange thing happens when an individual developer writes a code and test it, it works like a charm but sometimes, when the modules come together and integration testing happens, because of some loopholes, code breaks and nothing works :). Most of the times, developers waste their times in fixing those loopholes and I am sure, nobody likes to rework. BIG PROBLEM !!!
To solve this problem, concept of CI came in. CI stands for Continuous Integration. As name suggests, what If you integrate your development continually meaning, you can get hold on the loopholes exactly as and when they arise and you will be storing your right codes at a common directory or repository. Github for example.
Instead of waiting the developers to finish and test the codes, you can test the code while it is in development phase. These integration are tested globally while development . How cool is that ! That was about integration,
Let's talk about CD i.e. Continuous Deployment. Sometimes it is misinterpreted with continuous delivery. Both concepts are little different yet similar to each other.
Continuous Delivery :
Imagine Mr Customer asks about the ready model which is integrated and tested. To deliver the same, you can have a mock server which mimics the production server with all the features in working condition. Once, customer is happy and has confidence that this is the code or software he was looking for. It can be pushed to production environment, you can easily migrate from mock server to production server. That is delivery and that’s manual process.
The same software which was being tested and ready for customer will be deployed directly at production environment and that’s automatic process. That is called continuous deployment. This model is great when you work with microservices.
There are many tools which are used to support this concept i.e. ansible, dockers, kubernetes.
Hope this short article is good read for you. I will be discussing about the tools in my next articles.
Happy Reading !