Monday, July 20, 2020

CI CD Pipeline - how to Setup a CI CD Pipeline from Scratch

What is CI/CD?

Continuous integration (CI) and continuous delivery (CD) is collection of practices that enable application development teams to deliver code changes more frequently and reliably. CI/CD is one of the best practices for devOps teams to implement. It is also an agile methodology best practice, as it enables software development teams to focus on meeting business requirements, code quality, and security because deployment steps are automated. The implementation is also known as the CI/CD pipeline. 

CI CD Pipeline implementation or the Continuous Integration/Continuous Deployment software is the backbone of the modern DevOps environment. CI/CD bridges the gap between development and operations teams by automating build, test and deployment of applications.

Before moving onto the CI CD pipeline’s working, let’s start by understanding DevOps.

What is DevOps?

DevOps is a software development approach which involves continuous development, continuous testing, continuous integration, continuous deployment and continuous monitoring of the software throughout its development life cycle. This is exactly the process adopted by all the top companies to develop high-quality software and shorter development life cycles, resulting in greater customer satisfaction, something that every company wants.


What is CI CD Pipeline?
CI stands for Continuous Integration and CD stands for Continuous Delivery and Continuous Deployment. You can think of it as a process which is similar to a software development lifecycle.

Now let us see how does it work.


The above pipeline is a logical demonstration of how a software will move along the various phases or stages in this lifecycle, before it is delivered to the customer or before it is live on production. 

Let’s take a scenario of CI CD Pipeline. Imagine you’re going to build a web application which is going to be deployed on live web servers. You will have a set of developers who are responsible for writing the code which will further go on and build the web application. Now, when this code is committed into a version control system(such as git, svn) by the team of developers. Next, it goes through the build phase which is the first phase of the pipeline, where developers put in their code and then again code goes to the version control system having a proper version tag.

Suppose we have a Java code and it needs to be compiled before execution. So, through the version control phase, it again goes to build phase where it gets compiled. You get all the features of that code from various branches of the repository, which merge them and finally use a compiler to compile it. This whole process is called the build phase.

Testing Phase:
Once the build phase is over, then you move on to the testing phase. In this phase, we have various kinds of testing, one of them is the unit test (where you test the chunk/unit of software or for its sanity test).

Deploy Phase:
When the test is completed, you move on to the deploy phase, where you deploy it into a staging or a test server. Here, you can view the code or you can view the app in a simulator.


Auto Test Phase:
Once the code is deployed successfully, you can run another set of a sanity test. If everything is accepted, then it can be deployed to production.


Deploy to Production:
Meanwhile in every step, if there is some error, you can shoot a mail back to the development team so that they can fix them. Then they will push it into the version control system and goes back into the pipeline.

Once again if there is any error reported during testing, again the feedback goes to the dev team where they fix it and the process re-iterates if required.


Measure+Validate:
So, this lifecycle continues until we get a code or a product which can be deployed in the production server where we measure and validate the code.


We have understood CI CD Pipeline and its working, now we will move on to understand what Jenkins is and how we can deploy the demonstrated code using Jenkins and automate the entire process.

Jenkins – The Ultimate CI Tool and Its Importance in CI CD Pipeline

Our task is to automate the entire process, from the time the development team gives us the code and commits it to the time we get it into production.

Our task is to automate the pipeline in order to make the entire software development lifecycle on the dev-ops mode/ automated mode. For this, they would need automation tools.


Jenkins provides us with various interfaces and tools in order to automate the entire process.

So what happens, we have a git repository where the development team will commit the code. Then Jenkins takes over from there which is front-end tool where you can define your entire job or the task. Our job is to ensure the continuous integration and delivery process for that particular tool or for the particular application. 

From Git, Jenkins pulls the code and then moves it to the commit phase, where the code is committed from every branch. Then Jenkins moves it into the build phase where we compile the code. If it is Java code, we use tools like maven in Jenkins and then compile that code, which we can be deployed to run a series of tests. These test cases are overseen by Jenkins again.

Then it moves on to the staging server to deploy it using docker. After a series of Unit Tests or sanity test, it moves to the production.

This is how the delivery phase is taken care by a tool called Jenkins, which automate everything. Now in order to deploy it, we will need an environment which will replicate the production environment, I.e., Docker.

Docker:

Docker is just like a virtual environment in which we can create a server. It takes a few seconds to create an entire server and deploy the artifacts which we want to test. But here the question arises,


Why do we use docker? 

As said earlier, you can run the entire cluster in a few seconds. We have storage registry for images where you build your image and store it forever. You can use it anytime on any environment which can replicate itself. 

Unlike my other blogs, this one is having information mostly from the below Reference website.

25 comments:

  1. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! Agile Software Development

    ReplyDelete
  2. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. zcode system discount

    ReplyDelete
  3. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. zcodesystem discount

    ReplyDelete
  4. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up How to focus?

    ReplyDelete
  5. Good artcile, but it would be better if in future you can share more about this subject. Keep posting. Direct Response Copywriter

    ReplyDelete
  6. Nice Post! Thank you for the info information, I will wait for posts like this and will read them with pleasure. Pentesting Company

    ReplyDelete
  7. I felt very happy while reading this site. This was really very informative site for me. I really liked it. This was really a cordial post. Thanks a lot!. best pc software

    ReplyDelete
  8. hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. Office paket kaufen

    ReplyDelete
  9. Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. buy instagram views

    ReplyDelete
  10. I would recommend my profile is important to me, I invite you to discuss this topic. niche relevant

    ReplyDelete
  11. Hey friend, it is very well written article, thank you for the valuable and useful information you provide in this post. Keep up the good work! FYI, please check these art, drawing tips and drawing secrets related articles:

    Little Singham Drawing

    Doodle Art

    EASY Doodle Ideas

    Cool to Draw

    Easy Sketches


    You can also contact me at arthackers0172@gmail.com for link exchange, article exchange or for advertisement.

    Thanks a lot

    Dhruv

    ReplyDelete
  12. I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog!SMO company in Kanpur India

    ReplyDelete
  13. I must admit that your post is really interesting. I have spent a lot of my spare time reading your content. Thank you a lot! buy crypter

    ReplyDelete
  14. Very useful and knowledgeable. Really its Great Article. Keep it up. A complete APP solution for dokan marketplace for your customer, vendor, and Driver.

    Dokan Apps

    ReplyDelete
  15. I think this is an informative post and it is very useful and knowledgeable. Really its Great Article.Hire Shopify developer to transform your online store and attract new customers. Dedicated Shopify team.

    Hire Shopify Developer

    ReplyDelete
  16. Thanks for the blog post buddy! Keep them coming... Norstar

    ReplyDelete
  17. I love reading your strategies about ecommerce marketing. You can contact Best Ecommerce blogs if you want to know about the news and events about ecommerce marketing.
    Hire an Shopify Developer

    ReplyDelete
  18. I am grateful to you because your article is exceptionally useful for me to continue with my exploration in the same region. Your cited illustrations are all that significant to my exploration field. This is extraordinary! It exhibits to me were to broaden my online diary.Manufacturing Software Company in India

    ReplyDelete
  19. Nowadays, the user experience delivered by a https://entavio.com/the-best-software-to-manage-your-tasks-and-projects-asana-review/ application determines its popularity and profitability. The user experience delivered by an application depends on its accessibility, functionality, performance, usability, and security across various devices and platforms. Hence, it becomes essential for enterprises to focus on the quality and user experience of their applications throughout the software development lifecycle.

    ReplyDelete
  20. The post is written in very a good manner and it contains many useful information for me.
    custom mobile app development

    ReplyDelete
  21. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works.
    taxi app development

    ReplyDelete
  22. Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Thanks though. software development company uk

    ReplyDelete
  23. This is a wonderful post, I am very happy to read this article. Thanks for giving us this useful information. AT&T Software LLC comes with an incredible team of website and mobile application developers who can customize the perfect solutions to transform your business.

    hire woocommerce developer
    woocommerce development company

    ReplyDelete

Featured Posts