Jenkins - 一个版本有多少 CI/CD 管道? [英] Jenkins - How many CI/CD pipelines for a release?

查看:14
本文介绍了Jenkins - 一个版本有多少 CI/CD 管道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下 Git 工作流程,适用于任何版本,

Using below Git work flow, for any release,

对于持续交付,我的理解是,需要创建两条Jenkins管道,如下图:

For continuous delivery, my understanding is, two Jenkins pipe lines need to be created, as shown below:

1) 构建在每个 Feature 分支(绿色)合并到 Develop 分支(紫色)时触发的管道.Pipeline 将在 Nexus repo 中推送 product-x.y-snapshot.jar.这个 jar 的目的是用于 QA 测试

1) Build pipeline that gets triggered on merge of every Feature branch(green) into Develop branch(Purple). Pipeline will push product-x.y-snapshot.jar in Nexus repo. Purpose of this jar is for QA testing

2) 在每个新的 Release 分支合并到 Master 分支时触发的发布管道.Pipeline 将在 Nexus repo 中推送 product-x.y.jar.这个 jar 直接投入生产.

2) Release pipeline that gets triggered on merge of every new Release branch to Master branch. Pipeline will push product-x.y.jar in Nexus repo. This jar goes in production directly.

两个管道都对每个功能进行了自动测试.在两个管道中运行相同数量的自动测试

Both pipelines have auto-tests for every functionality. Same number of autotests run in both pipelines

1) 两条管道是否足以稳定发布?product-x.y.jar作为该版本的一部分添加了新功能

1) Does two pipelines suffice for stable release? product-x.y.jar with new features added as part of that release

2) 如果是,如何为构建和发布管道维护二进制工件?使用 Nexus...请提供任何参考

2) If yes, How binary artifactory has to be maintained for both build and release pipeline? using Nexus... please provide any reference

推荐答案

1) 这个问题没有一个正确答案 - 大多数情况下有两条管道(一个用于 feature 分支,另一个用于 ma​​ster 分支)足以创建稳定版本,但通常团队使用三个暂存环境(例如,请参阅 这篇文章):

1) This question doesn't have one right answer - in most cases two pipelines (one for feature branches and other for master branch) is sufficient for creating stable releases, but usually teams use three staging environments (for example, see details in this article):

  • Dev 环境:用于处理develop(或feature)分支并运行自动化测试;
  • QA环境:提供更稳定的代码版本供QA团队测试;
  • Prod 环境:用于构建当前位于 ma​​ster 分支上的生产就绪代码.
  • Dev environment: for working on develop (or feature) branch and run automation tests;
  • QA environment: for providing a more stable version of the code for testing by QA team;
  • Prod environment: for building production-ready code that is currently on the master branch.

在这种情况下,您可以为每个暂存环境使用三个管道(或一个带有用于选择和构建每种环境类型的参数的管道).网上有很多Jenkins持续交付配置的例子.

And in that case you can have three pipelines for each staging environment (or one pipeline with parameters for choosing and building each type of environment). There are a lot of examples of Jenkins continuous delivery configuration in the internet.

2) 如果我理解正确,为了维护工件,您可以使用 Nexus 平台插件(参见 this 示例)或 Nexus Artifact Uploader 将特定工件从 Jenkins 发布到 Nexus.

2) If I understand you correctly, for maintaining artifacts you can use Nexus Platform Plugin (see this example) or Nexus Artifact Uploader to publish a specific artifact from Jenkins to Nexus.

这篇关于Jenkins - 一个版本有多少 CI/CD 管道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆