Continuous integration and continuous delivery
DevOps, or Development Operations, is a practice combinging both Development and Systems Operations. It has a clear pipeline of "Develop, Build, Package, Test, Stage, Deploy". It involves five Continious aspects as well: Continiuous Integration, Continuous Delivery, Continious Testing, Continious Deployment, and Continuous Feedback
Continuous integration and continuous delivery are the core of DevOps. They embody a set of operating principles and practices that enable application development teams to deliver code changes more frequently and reliability. It allows collaboration and flexibility.
Tools of the CI/CD pipeline
There are several conponents of CI/CD pipeline.
1. Containers
2. Orchestraction
3. Cloud
4. Infrastructure Automation
5. Source Control
6. Continuous Monitoring
Continuous intergration
CI is a set of practices to implement small changes in check in code t version control repositories frequency. Most modern applications require developing code in different platforms and tools. The team needs a mechanism to integrate and validate its changes. It's a constant and automated way to build, package and test applications. This leads to better collaboration and software quality.
Implementing Continuous Interrogation is cheap, and not implementing it is expensive. If a company does not have a continuous approach, they will have longer periods between integration.
There are several benefits to CI:
Long and tense integration do not exist.
Increased visibility enabling rater communication
Catch issues easily and nip hem in the bug
Less time debugging and more time adding features
Build a solid foundation
Stop waiting to find out if your code will work.
Reduce integration problems allowing you to deliver software more rapidly.
CI is backed by several important principles and practices.
Maintain a single source repository
Automate the build
Make your build self-testing
Every commit should build on an integration machine
Keep the build fast
Test in a clone of the production environment
Make it easy for anyone to get the latest executable version
Everyone can see what’s happening
Automate deployment
How to do it
Developers check out code into their private workspaces
When done, commit the changes to the repository
The CI server monitors the repository and checks out changes when they occur
The CI server builds the system and runs unit and integration tests
The CI server releases deployable artifacts for testing
The CI server assigns a build label to the version of the code it just built
The CI server informs the team of the successful build
If the build or tests fail, the CI server alerts the team
The team fixes the issue at the earliest opportunity
Continue to continually integrate and test throughout the project
Team responsibilities
Check in frequently
Don’t check in broken code
Don’t check in untested code
Don’t check in when the build is broken
Don’t go home after checking in until the system builds
In short: CI is the practice of releasing every good build to users, by Jez Humble.
By adopting both continuous integration and continuous deployment, it will reduce risks and catch bugs quickly, but also move rapidly to working software.
CI is in short a practice where a team of developers integrate their code early and often to the main branch or code repository. The ultimate goal is to reduce the risk of seeing “integration hell” by waiting for the end of a project or a sprint to merge the work of all developers.
Continuous Delivery
CD automates the deliver of applications to selected infrastructure environments. They perform any necessary service calls to web servers, databases and other services that may need to be restarted or other procedures.
Both of them require continuous testing because the objective is to deliver quality application and code to users. This is done via a set of automated regression, performance, and other tests that are executed in the CI/CD pipeline.
A typical CD pipeline includes many of these steps:
• Pulling code from version control and executing a build.
• Executing any required infrastructure steps that are automated as code to stand up or tear down cloud infrastructure..
• Moving code to the target compute environment.
• Managing the environment variables and configuring them for the target environment.
• Pushing application components to their appropriate services, such as web servers, API services, and database services.
• Executing any steps required to restarts services or call service endpoints that are needed for new code pushes.
• Executing continuous tests and rollback environments if tests fail.
• Providing log data and alerts on the state of the delivery.
More sophisticated CD may have other steps including performing data synchronization, archiving information resources or performing some application and library patching.
The CI/CD pipelines are implemented on cloud environments, they use containers such as Docker an Kubernetes. Containers allow packaging and shipping applications in standard portable ways.