Continuous Integration- A Complete Introduction
Actual Meaning
Continuous Integration is a software development method where team members integrate their work at least once a day. In this method, every integration is checked by an automated build to detect errors. This concept was first introduced over two decades ago to avoid "integration hell," which happens when integration is put off till the end of a project.
In Continuous Integration after a code commit, the software is built and tested immediately. In a large project with many developers, commits are made many times during a day. With each commit code is built and tested. If the test is passed, build is tested for deployment. If the deployment is a success, the code is pushed to Production. This commit, build, test, and deploy is a continuous process, and hence the name continuous integration/deployment.
What do you need to conduct CI process?
Here, are the key elements which you need to perfom the entire CI process:
• Version Control System (VCS): It offers a reliable method to centralize and preserve changes made to your project over time.
• Virtual Machine: You should have a spare server or at least one virtual machine to build your system.
• Hosted CI Tool Solutions: To avoid servers or virtual machines, you should go for hosted CI tool solutions. This tool helps in the maintenance of the whole process and offers easier scalability.
• Tools: If you select a self-hosted variant, you will need to install one of the many CI tools like Jenkins, TeamCity, Bamboo, GitLab, etc.
How Continuous integration work?
You are surely aware of the old phone Nokia. Nokia used to implement a procedure called nightly build. After multiple commits from diverse developers during the day, the software built every night. Since the software was built only once in a day, it's a huge pain to isolate, identify, and fix the errors in a large codebase.
Later, they adopted the Continuous Integration approach. The software was built and tested as soon as a developer committed code. If any error is detected, the respective developer can quickly fix the defect.
Features of CI
Here, are important features and benefits of Continuous Integration:
• Allows you to maintain just a single source repository
• You can test the clone of the production CI environment
• The built environment should be close to the production environment.
• One of the advantages of continuous integration is Constant availability of a current build
• The complete process of build and testing and deployment should be visible to all the stack holders.
Why Use CI?
Here are important reasons for using Continuous Integration:
• Helps you to build better quality software
• CI process helps to scale up headcount and delivery output of engineering teams.
• CI allows software developers to work independently on features in parallel.
• Helps you to conduct repeatable testing
• Increase visibility enabling greater communication
• Helps develop a potentially shippable product for fully automated build
• Helps you to reduced risks by making deployment faster and more predictable
• immediate feedback when issue arrives
• Avoid last-minute confusion at release date and timing
Best practices of using CI Systems
Here, are some important best practices while implementing
• Commit Early and Commit Often never Commit Broken Code
• Fix build failures immediately
• Act on metrics
• Build-in every target environment Create artifacts from every build
• The build of the software need to be carried out in a manner so that it can be automated
• Do not depend on an IDE
• Build and test everything when it changes
• The database schema counts as everything
• Helps you to find out key metrics and track them visually
• Check-in often and early
• Stronger source code control
• Continuous integration is running unit tests whenever you commit code
• Automate the build and test everyone
• Keep the build fast with automated deployment
Disadvantages of CI
Here, are cons/drawbacks of Continuous Integration process:
• Initial setup time and training is required to get acquainted with Cl server
• Development of suitable test procedures is essential
• Well-developed test-suite required many resources for Cl server
• Conversion of familiar processes
• Requires additional servers and environments
• Waiting times may occur when multiple developers want to integrate their code around the same time
Tools for CI process
Here, are some most essential CI/CD tools:
Jenkins
Bamboo
TeamCity
Summary:
• Continuous Integration definition: Continuous integration is a software development method where members of the team can integrate their work at least once a day
• CI/CD meaning combination of Continuous Integration and Continuous Delivery or Continuous Deployment.
• Development without CI creates lots of bugs whereas Development with CI offers Fewer bugs
• Important activities of Continous Integration are
1) DB integration,
2) Code Inspection,
3) Automated Deployment, Document generation, and Compilation.
• The build should happen continuously using a dedicated Cl server, not a cron job.
• Important elements of CI are
1) Version Control System
2) Virtual Machine
3) Host CI Tool solutions
4) Tools
• Continuous Integration system allows you to maintain just a single source repository
• CI/CD process helps you to build better quality software
• The most important best practices of Azure Continuous Integration process is to Commit Early and Commit Often never Commit Broken Code
• The major drawback of the CICD pipeline process is that well-developed test-suite required many resources for Cl server
• Jenkins, Bamboo , and Team City are some useful AWS Continuous Integration tools.
That's a wrap.......mm