Ethickfox kb page with all notes
Definitions
**Continuous Integration
**Continuous integration requires individual developers working on the same code to continually commit their code branches to a shared repository, where they are merged into the main build. Automated testing verifies that nothing breaks with each merge; when issues arise, they are immediately spotted and resolved. With CI, teams agree on how frequently to commit code—with practices ranging from several times a day to as often as possible—and the status of the current build is made transparent to every team member.
**Continuous Delivery
**CD most often refers to continuous delivery: the assurance that every change committed is ready to go to production. Each integrated and validated build is automatically deployed to a staging environment in preparation for release; final deployment to production still requires human approval but then is carried out by tools. Continuous delivery puts the release schedule in the hands of the business instead of IT. With continuous delivery, any build can potentially be released to end users by clicking a button to trigger automated deployment in a matter of seconds or minutes.
**Continuous Deployment
**CD can also refer to continuous deployment. With continuous deployment, once the integrated build passes all automated quality tests, it is automatically deployed directly to production. The decision to go live becomes a technical one. The lack of human intervention at the deployment stage means automated testing must be of the highest quality. Continuous deployment is not an essential practice for every project, but it is especially beneficial for large organizations, such as Amazon, that release software daily.
The CI/CD Pipeline

CI/CD Pipeline as Code
A CI/CD pipeline as a script specifies the stages and the order in which the pipeline needs to run successfully. The following script demonstrates basic pipeline stages, such as build, test, and deploy:
pipeline {
agent {
docker{
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2'
}
}
stages {
stage('Build') {
steps {
sh ‘mvn -B -DskipTests clean package’
}
}
stage('Test') {
steps {
sh ‘mvn test’
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}
stage('Deploy') {
steps {
sh './jenkins/scripts/deploy.sh'
}
}
}
}
Basic Rules of CI/CD
**Use Version Control
**Track all code in a version control system. Make sure the VCS is the single source of truth. Nothing can be managed manually or off the record.
**Integrate Frequently in Small Batches
**Merge code in small pieces as frequently as possible. Because automated tests are run on every commit, it’s immediately clear which set of changes caused the issue. Developers can easily trace a broken build back to the exact lines of code that caused the problem. The more frequently developers commit, the smaller the change is. The smaller the change is, the faster and easier it is to find and fix issues.
Frequent integrations also minimize merge conflicts―the main root cause of integration issues. The more frequently developers merge code, the fewer merge conflicts arise, the easier testing is, and the fewer defects there are to fix.
**Build Once, Deploy Often
**Once a specific build (also known as the “artifact”) is created, run all tests against that build to confirm it is ready to go to production. Deploy the same artifact to at least one or two environments that match production as closely as possible.
**Automate End-to-End
**Building, testing, and deploying code without manual intervention is the key to reliable and reproducible updates. Even if you’re not planning to deploy code continuously to production, the final production deployment step should run fully unattended after being triggered by a human.
**Share Responsibility
**Fix the pipeline when something goes wrong. Do not push any new code until the problem is resolved—think of it like halting the assembly line in a factory. Fixing the build before resuming development work is the entire team’s responsibility.
**Build Fast, Fix Fast
**Slow build processes are counterproductive. Strive to eliminate redundant and time-consuming steps. Ensure that your build system has enough agents—environments in which builds of the CI/CD pipeline are run—and that the agents have sufficient system resources to build quickly.
CI Servers
A CI server―aka a build server―is a tool that enables continuous integration and delivery. Mature versions of a CI server available on the market support different VCSs and allow developers to choose:
Benefits of Using a CI Server
**Reproducibility
**A CI server provides an isolated, stable, and reproducible environment for builds, eliminating the “works on my machine” syndrome―a common problem when code written by one developer only works in certain environments. Using a CI server ensures that your builds won’t fail on other local machines or package the wrong libraries by mistake.
**Fast Build Time
**A build server can take the load of running automated tests from the developer’s local machine and run them in parallel. This is particularly beneficial for large and complex projects that may have a lengthy build time.
**Automation
**A build server can also execute any automated processes―such as pushing working code to a staging environment or running automated tests after each deployment―any time the team needs.
Selecting a CI Server
**Servers Integrated into a VCS
**Modern VCSs contain modules, such as GitLab CI and Bitbucket CI/CD, that provide CI/CD functionality.
**Dedicated Servers
**Dedicated servers, such as TeamCity and Jenkins, support CI/CD and can work with any VCS.
Концепция, которая реализуется как конвейер, облегчая слияние только что закомиченного кода в основную кодовую базу. Концепция позволяет запускать различные типы тестов на каждом этапе (выполнение интеграционного аспекта) и завершать его запуском с развертыванием закомиченного кода в фактический продукт, который видят конечные пользователи (выполнение доставки)
A CI/CD pipeline automates the process of software delivery. It builds code, runs tests, and helps you to safely deploy a new version of the software. CI/CD pipeline reduces manual errors, provides feedback to developers, and allows fast product iterations.
CI/CD pipeline introduces automation and continuous monitoring throughout the lifecycle of a software product. It involves from the integration and testing phase to delivery and deployment. These connected practices are referred as CI/CD pipeline.
An automation process for developers. Successful CI means new code changes to an app are regularly built, tested, and merged to a shared repository. It’s a solution to the problem of having too many branches of an app in development at once that might conflict with each other.In modern application development, the goal is to have multiple developers working simultaneously on different features of the same app. However, if an organization is set up to merge all branching source code together on one day (known as “merge day”), the resulting work can be tedious, manual, and time-intensive. That’s because when a developer working in isolation makes a change to an application, there’s a chance it will conflict with different changes being simultaneously made by other developers. This problem can be further compounded if each developer has customized their own local integrated development environment (IDE), rather than the team agreeing on one cloud-based IDE.Continuous integration (CI) helps developers merge their code changes back to a shared branch, or “trunk,” more frequently—sometimes even daily. Once a developer’s changes to an application are merged, those changes are validated by automatically building the application and running different levels of automated testing, typically unit and integration tests, to ensure the changes haven’t broken the app. This means testing everything from classes and function to the different modules that comprise the entire app. If automated testing discovers a conflict between new and existing code, CI makes it easier to fix those bugs quickly and often.
Continuous delivery usually means a developer’s changes to an application are automatically bug tested and uploaded to a repository (like GitHub or a container registry), where they can then be deployed to a live production environment by the operations team. It’s an answer to the problem of poor visibility and communication between dev and business teams. To that end, the purpose of continuous delivery is to ensure that it takes minimal effort to deploy new code. Following the automation of builds and unit and integration testing in CI, continuous delivery automates the release of that validated code to a repository. So, in order to have an effective continuous delivery process, it’s important that CI is already built into your development pipeline. The goal of continuous delivery is to have a codebase that is always ready for deployment to a production environment.
In continuous delivery, every stage—from the merger of code changes to the delivery of production-ready builds—involves test automation and code release automation. At the end of that process, the operations team is able to deploy an app to production quickly and easily.
Continuous deployment (the other possible "CD") can refer to automatically releasing a developer’s changes from the repository to production, where it is usable by customers. It addresses the problem of overloading operations teams with manual processes that slow down app delivery. It builds on the benefits of continuous delivery by automating the next stage in the pipeline. The final stage of a mature CI/CD pipeline is continuous deployment. As an extension of continuous delivery, which automates the release of a production-ready build to a code repository, continuous deployment automates releasing an app to production. Because there is no manual gate at the stage of the pipeline before production, continuous deployment relies heavily on well-designed test automation.In practice, continuous deployment means that a developer’s change to a cloud application could go live within minutes of writing it (assuming it passes automated testing). This makes it much easier to continuously receive and incorporate user feedback. Taken together, all of these connected CI/CD practices make deployment of an application less risky, whereby it’s easier to release changes to apps in small pieces, rather than all at once. There’s also a lot of upfront investment, though, since automated tests will need to be written to accommodate a variety of testing and release stages in the CI/CD pipeline.
Code pipelines are the primary technical artifacts of continuous delivery. Modern-day pipelines transform application and infrastructure source code into versioned packages deployable to any environment. By automating all the mundane tasks to build and deploy systems, teams are free to focus on value-added capabilities.
First of all it would be great to add pipelines for our etl services, or at least the deployment part. Because it’s uncomfortable to build it locally, send via ftp and update the current working version manually. For the neli we should add a trigger that will start build and testing process after each push
To automate testing and deployment of your product. To increase development speed. A CI/CD pipeline automates the process of software delivery.
CI/CD pipeline introduces automation and continuous monitoring throughout the lifecycle of a software product.
Example of pipeline