“Merge conflict” is one of the worst messages you can see inGitas a developer. You've spent hours working on a feature and finally have your code perfect. But someone else has changed the same part of the file, so now you need to compare the differences, choose which edits to keep, and run all your tests again before trying to merge a second time.

立即下载:免费html&css hacks

If a merge conflict occurs once in a while, it's a minor nuisance. But imagine you're working on a highly integrated team that's trying to push out new features at rapid speed. The timeline means that multiple developers need to work in the same file. If everyone waits until their individual contributions are finished to push to the repository, merge conflicts abound. This type of error is not only frustrating, but inefficient.

The CI/CD approach was created to solve this problem and streamline development. Let’s take a look at what this approach is, why it’s important, and what tools you can use to implement it.

CI/CD的目的是构建一条管道,将各个开发人员的代码编辑整合到共享分支中,测试针对演示环境中要求的更新,将已验证的代码包装到共享存储库中,并自动部署新软件版本。bob电竞官方下载

CI/CD diagram

图像源

CI/CD is typically practiced by agile development and operations teams following either aDevOps or site reliability engineering (SRE) approach。CI streamlines the coding and build processes for the development team, whereas CD streamlines the release and deployment processes for the operations team.

让我们检查CI/CD方法的每个组件。

持续集成

Continuous integration (CI) is an automation strategy meant to solve the challenges of merge conflicts between individual developers' code and separate code branches. CI introduces workflows to frequently compile code changes, build the application, and test the new version for bugs and errors. If it passes the testing suite, the updates are cleared for the next phase of the development process.

Inagile methodology,开发人员正在共同努力,以划分工作量并更快地创建功能。但是,所做的更改越多,一个编辑的机会就越高。

CI works to address this issue by frequently merging changes in a shared branch, sometimes referred to as a trunk branch. This strategy lowers the chance of merge conflicts versus waiting until the end of the coding phase to attempt to integrate separate branches, and any issues that do occur will be less complex and easier to resolve.

一旦合并了代码更改,该应用程序就会在演示环境中构建,并且automated testsare run against it. This ensures that edits are constantly being validated and lessens the risk of bugs making it to the delivery and deployment phase. Evaluations will range from unit tests of individual files to integration tests of the larger app infrastructure. If bugs are discovered, developers can address them quickly before more code is written on top of a defective code base.

组织通常通过关注CI组件开始构建其CI/CD管道。一旦他们自动化了合并过程,他们就会继续进行连续交付。

Continuous Delivery

持续交付下一个进化的utomation of the software lifecycle. Once code has been bug tested, it is immediately released to a shared repository like GitHub. Continuous delivery is intended to improve visibility and communication between the development and operations teams by speeding the rate at which production-ready code is delivered. The operations team can then deploy the application with ease.

Continuous delivery is only effective when CI is also implemented. Testing in the CI phase is critical to validate that code is ready for release to the repository. Otherwise, defective code is automatically delivered, leaving bugs that are then pushed to production.

现在已经实施了CI和连续交付的组织已准备好用于CI/CD管道的最终发展:连续部署。

Continuous Deployment

连续部署将连续交付的好处进一步迈进:现在,该代码被自动推向存储库,然后在同一过程中部署到生产。这减轻了运营团队的潜在负担,可以手动部署新版本,这可能取决于开发团队的步伐。

然而,自动化手动部署流程places an even greater emphasis on effective test automation during the CI phase because this is now the main failsafe before bugs are pushed to production.

With effective test design, continuous deployment streamlines the software development lifecycle. Now, a developer can make changes to a feature, and — assuming they clear the testing phase — those changes can go live in minutes. This creates an effective feedback loop where customers can raise issues and the development team can quickly address them.

Continuous deployment also enables simpler updates where small changes are released incrementally versus in one large batch, aligning with the agile methodology. The lower complexity of these updates means a lower risk of defects and issues.

video by Stephane Maarek回顾CI/CD的组成部分及其差异:

Now that you understand the individual pieces of CI/CD, let's review why it matters in the world of software development.

In addition to supporting these larger goals, CI/CD enables you to:

  • Ship software quickly and efficiently:CI/CD pipelines move applications from the coding to deployment phases at scale, ensuring that the pace of development matches the needs of the business.
  • 提高生产率:通过实现自动化过程,发展and operations teams are no longer spending time merging, building, testing, releasing, and deploying software manually. Instead, they can focus on writing better code and monitoring deployments for issues.
  • 降低交货风险:Testing every change before it's deployed ensures that the result will be a higher quality product and lower the rate of bugs in production. Customers will receive a better product, and the development team will spend less time fixing urgent defects discovered after release.
  • Incorporate user feedback faster:CI/CD删除了用于开发和运营团队的传统障碍,从而更快地发布了新功能以满足用户的需求。这将提高客户满意度,并为用户对未来项目重视的功能提供宝贵的见解。
  • Standardize processes:Automating the merge, test, delivery, and deployment processes means that they will always follow the same structure. This standardizes the pipeline, whereas manual execution of these tasks always comes with the risk of human error, such as executing tests in a different order.

Now that you understand the importance of CI/CD for speeding development and improving the end product, let's examine the CI/CD pipeline.

What is a CI/CD pipeline?

CI/CD管道是实践中的CI/CD哲学。该管道代表了实现CI/CD的软件开发方法的策略,人员和工具的组合。bob电竞官方下载它们通常构成较大的一部分DevOps管道被认为是best practicefor DevOps teams.

CI/CD管道图

图像源

Edureka的视频reviews the definition of CI/CD and then walks through how to create a CI/CD pipeline using Jenkins:

To build an effective CI/CD pipeline, you need the right tools.

CI/CD Tools

As with most automation strategies, CI/CD relies on tools to achieve optimal workflows. Below is a selection of tools purpose-built to orchestrate CI/CD pipelines.

CI/CD Tools

Let's review each one.

1。Jenkins

Price: 自由的

Jenkins Testing UI

Jenkins是一款构建的自动化服务器,旨在为几乎所有语言和存储库组合创建CI/CD环境。它提供了强大的功能,可以合并单个构建,测试,释放和部署工具,并使用脚本将它们连接到一个管道中,以协调各个步骤。詹金斯(Jenkins)是开源的,拥有1,600多个插件,使用户可以自动化CI/CD管道之外的开发任务。

2。CircleCI

PriceFree with paid plans available

Circleci UI

CircleCi是一个CI/CD自动化平台,重点是速度。它提供更改验证,以确保每个编辑在承诺之前都经过测试,并为每种编码语言以及多个执行环境提供普遍支持。此外,Circleci具有云和本地配置,并提供安装服务以及专用工程师的持续支持,以确保用户成功。

3。Spinnaker

Price: 自由的

Spinnaker UI

Spinnaker is an open-source continuous delivery platform that integrates with major cloud providers, including AWS, Google Cloud, Microsoft Azure, and Oracle Cloud. Its powerful and flexible pipeline management system provides integration and system testing as well as oversight for deployments through integration with monitoring tools such as Datadog, Stackdriver, and New Relic.

4。竹数据中心

PriceFree trial with paid plans available

竹数据中心Dashboard

Atlassian's Bamboo Data Center是CI服务器,专注于弹性,可靠性和可伸缩性,以确保CI/CD管道将始终与内置灾难恢复一起使用。该平台与其他Atlassian产品套件集成在一起,包括Bitbucket和Jira,以支持开发工作流和OPSGENIE,以为运营团队提供事件调查功能。

5。Travis CI

PriceFree trial with paid plans available

Travis CI UI

Travis CI是一种自动测试和部署服务器,与汇编,Bitbucket,github或Gitlab存储库连接,以在合并之前测试拉动请求。通过的构建将自动部署。Travis CI为开源项目提供无需成本测试,并支持30多种语言,包括Java,Node.js,PHP,Ruby和Python

In addition to the purpose-built CI/CD tools listed here, any tool that powers a DevOps pipeline will likely make up part of the CI/CD workflow. For example, a version control system like Git will be needed to track developers' changes and maintain branches for merging edits during the CI phase. Find more solutions in this list ofDevOps tools

Supercharge your DevOps team with CI/CD.

CI/CD supports modern development by shortening the time between coding and deployment. It maximizes development and operations teams' time by automating manual steps of the integration, delivery, and deployment processes while reducing bugs through a well-designed testing suite. CI/CD forms the backbone of DevOps and SRE methodologies by enabling the team to match the speed of the business.

New Call-to-action

css introduction

Originally published Feb 8, 2022 7:00:00 AM, updated February 08 2022

主题:

Developer Operations